summaryrefslogtreecommitdiffstats
path: root/routers/admin
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 /routers/admin
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 'routers/admin')
-rw-r--r--routers/admin/auths.go42
1 files changed, 24 insertions, 18 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go
index e537572b41..dcb98d3303 100644
--- a/routers/admin/auths.go
+++ b/routers/admin/auths.go
@@ -63,15 +63,18 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
case models.LDAP:
u = &models.LDAPConfig{
Ldapsource: ldap.Ldapsource{
- Host: form.Host,
- Port: form.Port,
- UseSSL: form.UseSSL,
- BaseDN: form.BaseDN,
- Attributes: form.Attributes,
- Filter: form.Filter,
- MsAdSAFormat: form.MsAdSA,
- Enabled: true,
- Name: form.AuthName,
+ Host: form.Host,
+ Port: form.Port,
+ UseSSL: form.UseSSL,
+ BaseDN: form.BaseDN,
+ AttributeUsername: form.AttributeUsername,
+ AttributeName: form.AttributeName,
+ AttributeSurname: form.AttributeSurname,
+ AttributeMail: form.AttributeMail,
+ Filter: form.Filter,
+ MsAdSAFormat: form.MsAdSA,
+ Enabled: true,
+ Name: form.AuthName,
},
}
case models.SMTP:
@@ -142,15 +145,18 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
case models.LDAP:
config = &models.LDAPConfig{
Ldapsource: ldap.Ldapsource{
- Host: form.Host,
- Port: form.Port,
- UseSSL: form.UseSSL,
- BaseDN: form.BaseDN,
- Attributes: form.Attributes,
- Filter: form.Filter,
- MsAdSAFormat: form.MsAdSA,
- Enabled: true,
- Name: form.AuthName,
+ Host: form.Host,
+ Port: form.Port,
+ UseSSL: form.UseSSL,
+ BaseDN: form.BaseDN,
+ AttributeUsername: form.AttributeUsername,
+ AttributeName: form.AttributeName,
+ AttributeSurname: form.AttributeSurname,
+ AttributeMail: form.AttributeMail,
+ Filter: form.Filter,
+ MsAdSAFormat: form.MsAdSA,
+ Enabled: true,
+ Name: form.AuthName,
},
}
case models.SMTP: