|
|
@ -77,7 +77,7 @@ type LoginSource struct { |
|
|
|
Cfg core.Conversion `xorm:"TEXT"` |
|
|
|
Cfg core.Conversion `xorm:"TEXT"` |
|
|
|
Created time.Time `xorm:"created"` |
|
|
|
Created time.Time `xorm:"created"` |
|
|
|
Updated time.Time `xorm:"updated"` |
|
|
|
Updated time.Time `xorm:"updated"` |
|
|
|
AllowAutoRegisted bool `xorm:"not null default false"` |
|
|
|
AllowAutoRegister bool `xorm:"not null default false"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (source *LoginSource) TypeString() string { |
|
|
|
func (source *LoginSource) TypeString() string { |
|
|
@ -180,7 +180,7 @@ func LoginUser(uname, passwd string) (*User, error) { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if !has { |
|
|
|
if !has { |
|
|
|
var sources []LoginSource |
|
|
|
var sources []LoginSource |
|
|
|
cond := &LoginSource{IsActived: true, AllowAutoRegisted: true} |
|
|
|
cond := &LoginSource{IsActived: true, AllowAutoRegister: true} |
|
|
|
err = orm.UseBool().Find(&sources, cond) |
|
|
|
err = orm.UseBool().Find(&sources, cond) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|