summaryrefslogtreecommitdiffstats
path: root/models/login.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2015-02-08 01:49:51 +0200
committerLauris BH <lauris@nix.lv>2015-02-08 01:49:51 +0200
commit00653e52ee078ae76872f722f056805fb75d98af (patch)
tree0d41957f773ff9f2e0da9904627ee0e6961f7abb /models/login.go
parentba77a3b0b4bfcc418301c5069d9dd57d05ea23c3 (diff)
downloadgitea-00653e52ee078ae76872f722f056805fb75d98af.tar.gz
gitea-00653e52ee078ae76872f722f056805fb75d98af.zip
Get username, name, surname and e-mail from LDAP server
Diffstat (limited to 'models/login.go')
-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,