summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-02-23 13:41:29 -0500
committer无闻 <u@gogs.io>2015-02-23 13:41:29 -0500
commitcd8b43d9844cb0de3ef7887178140f1dc43ec72c (patch)
treecbb401237beac8b18145ac8186f30d2c113f131a /models
parent2369881808a906f3072c935ab0575f08bd358821 (diff)
parent00653e52ee078ae76872f722f056805fb75d98af (diff)
downloadgitea-cd8b43d9844cb0de3ef7887178140f1dc43ec72c.tar.gz
gitea-cd8b43d9844cb0de3ef7887178140f1dc43ec72c.zip
Merge pull request #915 from Lafriks/dev
Get username, name, surname and e-mail from LDAP server
Diffstat (limited to 'models')
-rw-r--r--models/login.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/login.go b/models/login.go
index 125e110a40..1dc1b6cad3 100644
--- a/models/login.go
+++ b/models/login.go
@@ -231,7 +231,7 @@ 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) {
- mail, logged := cfg.Ldapsource.SearchEntry(name, passwd)
+ name, fn, sn, mail, logged := cfg.Ldapsource.SearchEntry(name, passwd)
if !logged {
// User not in LDAP, do nothing
return nil, ErrUserNotExist
@@ -247,6 +247,7 @@ func LoginUserLdapSource(u *User, name, passwd string, sourceId int64, cfg *LDAP
u = &User{
Name: name,
+ FullName: fn + " " + sn,
LoginType: LDAP,
LoginSource: sourceId,
LoginName: name,