diff options
author | Sandro Santilli <strk@kbt.io> | 2016-11-07 17:30:04 +0100 |
---|---|---|
committer | Sandro Santilli <strk@kbt.io> | 2016-11-07 17:30:04 +0100 |
commit | 60c82a87805821ad6eaf5aeb58a3a266b56a30ff (patch) | |
tree | ddc3675e4133284dbe7fa1b2bbd10ed7d38ff6fc /routers | |
parent | f6a11e0de1ab950b42679d6be9dc0f3ac86c3399 (diff) | |
download | gitea-60c82a87805821ad6eaf5aeb58a3a266b56a30ff.tar.gz gitea-60c82a87805821ad6eaf5aeb58a3a266b56a30ff.zip |
More...
Diffstat (limited to 'routers')
-rw-r--r-- | routers/admin/auths.go | 10 | ||||
-rw-r--r-- | routers/admin/users.go | 2 | ||||
-rw-r--r-- | routers/api/v1/admin/user.go | 2 | ||||
-rw-r--r-- | routers/api/v1/repo/issue_comment.go | 2 | ||||
-rw-r--r-- | routers/repo/issue.go | 10 |
5 files changed, 13 insertions, 13 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go index dcd9a225a7..44fe0ee9fb 100644 --- a/routers/admin/auths.go +++ b/routers/admin/auths.go @@ -48,7 +48,7 @@ type dropdownItem struct { var ( authSources = []dropdownItem{ - {models.LoginNames[models.LOGIN_LDAP], models.LOGIN_LDAP}, + {models.LoginNames[models.LoginLdap], models.LoginLdap}, {models.LoginNames[models.LOGIN_DLDAP], models.LOGIN_DLDAP}, {models.LoginNames[models.LOGIN_SMTP], models.LOGIN_SMTP}, {models.LoginNames[models.LOGIN_PAM], models.LOGIN_PAM}, @@ -65,8 +65,8 @@ func NewAuthSource(ctx *context.Context) { ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminAuthentications"] = true - ctx.Data["type"] = models.LOGIN_LDAP - ctx.Data["CurrentTypeName"] = models.LoginNames[models.LOGIN_LDAP] + ctx.Data["type"] = models.LoginLdap + ctx.Data["CurrentTypeName"] = models.LoginNames[models.LoginLdap] ctx.Data["CurrentSecurityProtocol"] = models.SecurityProtocolNames[ldap.SECURITY_PROTOCOL_UNENCRYPTED] ctx.Data["smtp_auth"] = "PLAIN" ctx.Data["is_active"] = true @@ -125,7 +125,7 @@ func NewAuthSourcePost(ctx *context.Context, form auth.AuthenticationForm) { hasTLS := false var config core.Conversion switch models.LoginType(form.Type) { - case models.LOGIN_LDAP, models.LOGIN_DLDAP: + case models.LoginLdap, models.LOGIN_DLDAP: config = parseLDAPConfig(form) hasTLS = ldap.SecurityProtocol(form.SecurityProtocol) > ldap.SECURITY_PROTOCOL_UNENCRYPTED case models.LOGIN_SMTP: @@ -208,7 +208,7 @@ func EditAuthSourcePost(ctx *context.Context, form auth.AuthenticationForm) { var config core.Conversion switch models.LoginType(form.Type) { - case models.LOGIN_LDAP, models.LOGIN_DLDAP: + case models.LoginLdap, models.LOGIN_DLDAP: config = parseLDAPConfig(form) case models.LOGIN_SMTP: config = parseSMTPConfig(form) diff --git a/routers/admin/users.go b/routers/admin/users.go index 0eaa3c995c..404d5ec3b1 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -81,7 +81,7 @@ func NewUserPost(ctx *context.Context, form auth.AdminCrateUserForm) { Email: form.Email, Passwd: form.Password, IsActive: true, - LoginType: models.LOGIN_PLAIN, + LoginType: models.LoginPlain, } if len(form.LoginType) > 0 { diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 1234dbf0c7..5e9f763eeb 100644 --- a/routers/api/v1/admin/user.go +++ b/routers/api/v1/admin/user.go @@ -42,7 +42,7 @@ func CreateUser(ctx *context.APIContext, form api.CreateUserOption) { Email: form.Email, Passwd: form.Password, IsActive: true, - LoginType: models.LOGIN_PLAIN, + LoginType: models.LoginPlain, } parseLoginSource(ctx, u, form.SourceID, form.LoginName) diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index 28751008da..11e236144c 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -68,7 +68,7 @@ func EditIssueComment(ctx *context.APIContext, form api.EditIssueCommentOption) if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.IsAdmin()) { ctx.Status(403) return - } else if comment.Type != models.COMMENT_TYPE_COMMENT { + } else if comment.Type != models.CommentTypeComment { ctx.Status(204) return } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 9dff643ea4..d3a91c84cc 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -599,7 +599,7 @@ func ViewIssue(ctx *context.Context) { // Render comments and and fetch participants. participants[0] = issue.Poster for _, comment = range issue.Comments { - if comment.Type == models.COMMENT_TYPE_COMMENT { + if comment.Type == models.CommentTypeComment { comment.RenderedContent = string(markdown.Render([]byte(comment.Content), ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas())) @@ -614,9 +614,9 @@ func ViewIssue(ctx *context.Context) { (repo.Owner.IsOrganization() && repo.Owner.IsOwnedBy(comment.PosterID)) { comment.ShowTag = models.COMMENT_TAG_OWNER } else if comment.Poster.IsWriterOfRepo(repo) { - comment.ShowTag = models.COMMENT_TAG_WRITER + comment.ShowTag = models.CommentTagWriter } else if comment.PosterID == issue.PosterID { - comment.ShowTag = models.COMMENT_TAG_POSTER + comment.ShowTag = models.CommentTagPoster } marked[comment.PosterID] = comment.ShowTag @@ -892,7 +892,7 @@ func UpdateCommentContent(ctx *context.Context) { if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.IsAdmin()) { ctx.Error(403) return - } else if comment.Type != models.COMMENT_TYPE_COMMENT { + } else if comment.Type != models.CommentTypeComment { ctx.Error(204) return } @@ -924,7 +924,7 @@ func DeleteComment(ctx *context.Context) { if !ctx.IsSigned || (ctx.User.ID != comment.PosterID && !ctx.Repo.IsAdmin()) { ctx.Error(403) return - } else if comment.Type != models.COMMENT_TYPE_COMMENT { + } else if comment.Type != models.CommentTypeComment { ctx.Error(204) return } |