summaryrefslogtreecommitdiffstats
path: root/routers/admin
diff options
context:
space:
mode:
authorSandro Santilli <strk@kbt.io>2016-11-07 21:58:22 +0100
committerAndrey Nering <andrey.nering@gmail.com>2016-11-07 18:58:22 -0200
commit864d1b1f9f6a72589d77ec0f08b21c476b8e13d4 (patch)
treece425602ac6e31e6b7d4bc65e9591849e9ec96f9 /routers/admin
parentc8c748aea6a864c5cf8a2235d15f413188c0a22d (diff)
downloadgitea-864d1b1f9f6a72589d77ec0f08b21c476b8e13d4.tar.gz
gitea-864d1b1f9f6a72589d77ec0f08b21c476b8e13d4.zip
Fix type in unused constant name (#111)
* Write LDAP, SMTP, PAM, DLDAP back to all uppercase * Fix type in unused constant name * Other MixCased fixes * Complete MixerCasing of template constants * Re uppercase LTS and LDAPS suffixes * Uppercase JSON suffix in constant names * Proper case LoginNoType * Prefix unexported template path constants with "tpl"
Diffstat (limited to 'routers/admin')
-rw-r--r--routers/admin/auths.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go
index 39c028ee07..af01c016c2 100644
--- a/routers/admin/auths.go
+++ b/routers/admin/auths.go
@@ -48,15 +48,15 @@ type dropdownItem struct {
var (
authSources = []dropdownItem{
- {models.LoginNames[models.LoginLdap], models.LoginLdap},
- {models.LoginNames[models.LoginDldap], models.LoginDldap},
- {models.LoginNames[models.LoginSmtp], models.LoginSmtp},
- {models.LoginNames[models.LoginPam], models.LoginPam},
+ {models.LoginNames[models.LoginLDAP], models.LoginLDAP},
+ {models.LoginNames[models.LoginDLDAP], models.LoginDLDAP},
+ {models.LoginNames[models.LoginSMTP], models.LoginSMTP},
+ {models.LoginNames[models.LoginPAM], models.LoginPAM},
}
securityProtocols = []dropdownItem{
{models.SecurityProtocolNames[ldap.SecurityProtocolUnencrypted], ldap.SecurityProtocolUnencrypted},
- {models.SecurityProtocolNames[ldap.SecurityProtocolLdaps], ldap.SecurityProtocolLdaps},
- {models.SecurityProtocolNames[ldap.SecurityProtocolStartTls], ldap.SecurityProtocolStartTls},
+ {models.SecurityProtocolNames[ldap.SecurityProtocolLDAPS], ldap.SecurityProtocolLDAPS},
+ {models.SecurityProtocolNames[ldap.SecurityProtocolStartTLS], ldap.SecurityProtocolStartTLS},
}
)
@@ -65,8 +65,8 @@ func NewAuthSource(ctx *context.Context) {
ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminAuthentications"] = true
- ctx.Data["type"] = models.LoginLdap
- ctx.Data["CurrentTypeName"] = models.LoginNames[models.LoginLdap]
+ ctx.Data["type"] = models.LoginLDAP
+ ctx.Data["CurrentTypeName"] = models.LoginNames[models.LoginLDAP]
ctx.Data["CurrentSecurityProtocol"] = models.SecurityProtocolNames[ldap.SecurityProtocolUnencrypted]
ctx.Data["smtp_auth"] = "PLAIN"
ctx.Data["is_active"] = true
@@ -125,13 +125,13 @@ func NewAuthSourcePost(ctx *context.Context, form auth.AuthenticationForm) {
hasTLS := false
var config core.Conversion
switch models.LoginType(form.Type) {
- case models.LoginLdap, models.LoginDldap:
+ case models.LoginLDAP, models.LoginDLDAP:
config = parseLDAPConfig(form)
hasTLS = ldap.SecurityProtocol(form.SecurityProtocol) > ldap.SecurityProtocolUnencrypted
- case models.LoginSmtp:
+ case models.LoginSMTP:
config = parseSMTPConfig(form)
hasTLS = true
- case models.LoginPam:
+ case models.LoginPAM:
config = &models.PAMConfig{
ServiceName: form.PAMServiceName,
}
@@ -208,11 +208,11 @@ func EditAuthSourcePost(ctx *context.Context, form auth.AuthenticationForm) {
var config core.Conversion
switch models.LoginType(form.Type) {
- case models.LoginLdap, models.LoginDldap:
+ case models.LoginLDAP, models.LoginDLDAP:
config = parseLDAPConfig(form)
- case models.LoginSmtp:
+ case models.LoginSMTP:
config = parseSMTPConfig(form)
- case models.LoginPam:
+ case models.LoginPAM:
config = &models.PAMConfig{
ServiceName: form.PAMServiceName,
}