diff options
author | Sergio Benitez <sbenitez@mit.edu> | 2015-09-04 20:39:23 -0700 |
---|---|---|
committer | Sergio Benitez <sbenitez@mit.edu> | 2015-09-04 20:48:34 -0700 |
commit | 2d1db4bf055a425bf4529b2f9f0378d58e3ec648 (patch) | |
tree | f80ae018153c12316a0144458b187171fcd53523 /routers/admin | |
parent | 36a69e8aa5a3bd35396173b4f108b33c19e6ac88 (diff) | |
download | gitea-2d1db4bf055a425bf4529b2f9f0378d58e3ec648.tar.gz gitea-2d1db4bf055a425bf4529b2f9f0378d58e3ec648.zip |
Added LDAP simple auth support.
Diffstat (limited to 'routers/admin')
-rw-r--r-- | routers/admin/auths.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go index 3e552082ee..1f4be231e9 100644 --- a/routers/admin/auths.go +++ b/routers/admin/auths.go @@ -61,6 +61,8 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { var u core.Conversion switch models.LoginType(form.Type) { case models.LDAP: + fallthrough + case models.DLDAP: u = &models.LDAPConfig{ Ldapsource: ldap.Ldapsource{ Name: form.Name, @@ -68,13 +70,14 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Port: form.Port, UseSSL: form.UseSSL, BindDN: form.BindDN, + UserDN: form.UserDN, BindPassword: form.BindPassword, UserBase: form.UserBase, - Filter: form.Filter, - AdminFilter: form.AdminFilter, AttributeName: form.AttributeName, AttributeSurname: form.AttributeSurname, AttributeMail: form.AttributeMail, + Filter: form.Filter, + AdminFilter: form.AdminFilter, Enabled: true, }, } @@ -149,6 +152,8 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { var config core.Conversion switch models.LoginType(form.Type) { case models.LDAP: + fallthrough + case models.DLDAP: config = &models.LDAPConfig{ Ldapsource: ldap.Ldapsource{ Name: form.Name, @@ -156,6 +161,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Port: form.Port, UseSSL: form.UseSSL, BindDN: form.BindDN, + UserDN: form.UserDN, BindPassword: form.BindPassword, UserBase: form.UserBase, AttributeName: form.AttributeName, |