Browse Source

minor fix on #1581

pull/1629/head
Unknwon 9 years ago
parent
commit
26ac016b9f
  1. 2
      conf/locale/locale_en-US.ini
  2. 11
      models/login.go
  3. 4
      modules/bindata/bindata.go

2
conf/locale/locale_en-US.ini

@ -334,7 +334,7 @@ license = License
license_helper = Select a license file license_helper = Select a license file
readme = Readme readme = Readme
readme_helper = Select a readme template readme_helper = Select a readme template
auto_init = Initialize this repository selected files and template auto_init = Initialize this repository with selected files and template
create_repo = Create Repository create_repo = Create Repository
default_branch = Default Branch default_branch = Default Branch
mirror_interval = Mirror Interval (hour) mirror_interval = Mirror Interval (hour)

11
models/login.go

@ -23,13 +23,14 @@ import (
type LoginType int type LoginType int
// Note: new type must be added at the end of list to maintain compatibility.
const ( const (
NOTYPE LoginType = iota NOTYPE LoginType = iota
PLAIN PLAIN
LDAP LDAP
DLDAP
SMTP SMTP
PAM PAM
DLDAP
) )
var ( var (
@ -107,9 +108,7 @@ func (source *LoginSource) BeforeSet(colName string, val xorm.Cell) {
switch colName { switch colName {
case "type": case "type":
switch LoginType((*val).(int64)) { switch LoginType((*val).(int64)) {
case LDAP: case LDAP, DLDAP:
fallthrough
case DLDAP:
source.Cfg = new(LDAPConfig) source.Cfg = new(LDAPConfig)
case SMTP: case SMTP:
source.Cfg = new(SMTPConfig) source.Cfg = new(SMTPConfig)
@ -233,9 +232,7 @@ func ExternalUserLogin(u *User, name, passwd string, source *LoginSource, autoRe
} }
switch source.Type { switch source.Type {
case LDAP: case LDAP, DLDAP:
fallthrough
case DLDAP:
return LoginUserLdapSource(u, name, passwd, source, autoRegister) return LoginUserLdapSource(u, name, passwd, source, autoRegister)
case SMTP: case SMTP:
return LoginUserSMTPSource(u, name, passwd, source.ID, source.Cfg.(*SMTPConfig), autoRegister) return LoginUserSMTPSource(u, name, passwd, source.ID, source.Cfg.(*SMTPConfig), autoRegister)

4
modules/bindata/bindata.go

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save