summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-08-19 18:46:28 +0800
committer无闻 <u@gogs.io>2015-08-19 18:46:28 +0800
commit2b393f5b039db177a58be03f1c5c746eac501686 (patch)
treefb3b376e4604369d81c2913a4176873efd07949e /models
parenta5e1ada4745aca488d5de3479606f2e9ecd19e42 (diff)
parent24d7a86a8d35aa1fadf05deaa10e141d33ea6632 (diff)
downloadgitea-2b393f5b039db177a58be03f1c5c746eac501686.tar.gz
gitea-2b393f5b039db177a58be03f1c5c746eac501686.zip
Merge pull request #1507 from cloudron-io/develop
Set IsAdmin using LDAP
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 8ac4b827ef..78a607263f 100644
--- a/models/login.go
+++ b/models/login.go
@@ -257,7 +257,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) {
- fn, sn, mail, logged := cfg.Ldapsource.SearchEntry(name, passwd)
+ fn, sn, mail, admin, logged := cfg.Ldapsource.SearchEntry(name, passwd)
if !logged {
// User not in LDAP, do nothing
return nil, ErrUserNotExist{0, name}
@@ -281,6 +281,7 @@ func LoginUserLdapSource(u *User, name, passwd string, sourceId int64, cfg *LDAP
LoginName: name,
Passwd: passwd,
Email: mail,
+ IsAdmin: admin,
IsActive: true,
}
return u, CreateUser(u)