diff options
author | Unknwon <u@gogs.io> | 2015-08-16 14:31:54 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-16 14:31:54 +0800 |
commit | 55ccb00a47e580efc1cf184e31dd19f05137a4b3 (patch) | |
tree | ad538b0525a886c8f1c0549709e8b97ac8e811d0 /models | |
parent | 6d3e5a36a1d81cc690807768de3f686699f4c171 (diff) | |
parent | f8a4ab25fda9731803e787160f54d767d1b57eef (diff) |
Merge branch 'develop' of https://github.com/SergioBenitez/gogs into develop
# Conflicts:
# modules/bindata/bindata.go
Diffstat (limited to 'models')
-rw-r--r-- | models/login.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/login.go b/models/login.go index 82cea35f..8ac4b827 100644 --- a/models/login.go +++ b/models/login.go @@ -19,7 +19,6 @@ import ( "github.com/gogits/gogs/modules/auth/ldap" "github.com/gogits/gogs/modules/auth/pam" "github.com/gogits/gogs/modules/log" - "github.com/gogits/gogs/modules/uuid" ) type LoginType int @@ -258,18 +257,19 @@ func UserSignIn(uname, passwd string) (*User, error) { // Return the same LoginUserPlain semantic // FIXME: https://github.com/gogits/gogs/issues/672 func LoginUserLdapSource(u *User, name, passwd string, sourceId int64, cfg *LDAPConfig, autoRegister bool) (*User, error) { - name, fn, sn, mail, logged := cfg.Ldapsource.SearchEntry(name, passwd) + fn, sn, mail, logged := cfg.Ldapsource.SearchEntry(name, passwd) if !logged { // User not in LDAP, do nothing - return nil, ErrUserNotExist{u.Id, u.Name} + return nil, ErrUserNotExist{0, name} } + if !autoRegister { return u, nil } // Fallback. if len(mail) == 0 { - mail = uuid.NewV4().String() + "@localhost" + mail = fmt.Sprintf("%s@localhost", name) } u = &User{ |