diff options
author | Unknwon <u@gogs.io> | 2015-09-10 15:03:14 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-10 15:03:14 -0400 |
commit | 26ac016b9fb6b3fb308996e2ee56dad0b794aa49 (patch) | |
tree | ff6f667e8f9463d36506f2b6c7e83fb2c8846075 /models | |
parent | cbd6276200751f4b64a203767f0f454c3346fca1 (diff) | |
download | gitea-26ac016b9fb6b3fb308996e2ee56dad0b794aa49.tar.gz gitea-26ac016b9fb6b3fb308996e2ee56dad0b794aa49.zip |
minor fix on #1581
Diffstat (limited to 'models')
-rw-r--r-- | models/login.go | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/models/login.go b/models/login.go index b4cb60ad68..a7d07d50f4 100644 --- a/models/login.go +++ b/models/login.go @@ -23,13 +23,14 @@ import ( type LoginType int +// Note: new type must be added at the end of list to maintain compatibility. const ( NOTYPE LoginType = iota PLAIN LDAP - DLDAP SMTP PAM + DLDAP ) var ( @@ -107,9 +108,7 @@ func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) { switch colName { case "type": switch LoginType((*val).(int64)) { - case LDAP: - fallthrough - case DLDAP: + case LDAP, DLDAP: source.Cfg = new(LDAPConfig) case SMTP: source.Cfg = new(SMTPConfig) @@ -233,9 +232,7 @@ func ExternalUserLogin(u *User, name, passwd string, source *LoginSource, autoRe } switch source.Type { - case LDAP: - fallthrough - case DLDAP: + case LDAP, DLDAP: return LoginUserLdapSource(u, name, passwd, source, autoRegister) case SMTP: return LoginUserSMTPSource(u, name, passwd, source.ID, source.Cfg.(*SMTPConfig), autoRegister) |