diff options
author | Lauris BH <lauris@nix.lv> | 2015-02-08 01:49:51 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2015-02-08 01:49:51 +0200 |
commit | 00653e52ee078ae76872f722f056805fb75d98af (patch) | |
tree | 0d41957f773ff9f2e0da9904627ee0e6961f7abb /routers/admin | |
parent | ba77a3b0b4bfcc418301c5069d9dd57d05ea23c3 (diff) | |
download | gitea-00653e52ee078ae76872f722f056805fb75d98af.tar.gz gitea-00653e52ee078ae76872f722f056805fb75d98af.zip |
Get username, name, surname and e-mail from LDAP server
Diffstat (limited to 'routers/admin')
-rw-r--r-- | routers/admin/auths.go | 42 |
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: |