diff options
author | Unknown <joe2010xtmf@163.com> | 2014-06-08 17:53:53 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-06-08 17:53:53 -0400 |
commit | f160b4f33ca69df13b071648aad09e561dafec26 (patch) | |
tree | dc630164a3c25c70e4ce5f2257b1a4a69a488d7a /routers/admin/auths.go | |
parent | 1f58d6f5d912187653db442e17d20261fc970b7b (diff) | |
download | gitea-f160b4f33ca69df13b071648aad09e561dafec26.tar.gz gitea-f160b4f33ca69df13b071648aad09e561dafec26.zip |
Add tar.gz download button and other mirror updates
Diffstat (limited to 'routers/admin/auths.go')
-rw-r--r-- | routers/admin/auths.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go index c4702afc81..e0b9971481 100644 --- a/routers/admin/auths.go +++ b/routers/admin/auths.go @@ -38,8 +38,8 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var u core.Conversion - switch form.Type { - case models.LT_LDAP: + switch models.LoginType(form.Type) { + case models.LDAP: u = &models.LDAPConfig{ Ldapsource: ldap.Ldapsource{ Host: form.Host, @@ -53,7 +53,7 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Name: form.AuthName, }, } - case models.LT_SMTP: + case models.SMTP: u = &models.SMTPConfig{ Auth: form.SmtpAuth, Host: form.SmtpHost, @@ -66,14 +66,14 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var source = &models.LoginSource{ - Type: form.Type, + Type: models.LoginType(form.Type), Name: form.AuthName, IsActived: true, AllowAutoRegister: form.AllowAutoRegister, Cfg: u, } - if err := models.AddSource(source); err != nil { + if err := models.CreateSource(source); err != nil { ctx.Handle(500, "admin.auths.NewAuth", err) return } @@ -116,8 +116,8 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { } var config core.Conversion - switch form.Type { - case models.LT_LDAP: + switch models.LoginType(form.Type) { + case models.LDAP: config = &models.LDAPConfig{ Ldapsource: ldap.Ldapsource{ Host: form.Host, @@ -131,7 +131,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Name: form.AuthName, }, } - case models.LT_SMTP: + case models.SMTP: config = &models.SMTPConfig{ Auth: form.SmtpAuth, Host: form.SmtpHost, @@ -147,7 +147,7 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) { Id: form.Id, Name: form.AuthName, IsActived: form.IsActived, - Type: form.Type, + Type: models.LoginType(form.Type), AllowAutoRegister: form.AllowAutoRegister, Cfg: config, } |