summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-10 19:02:57 -0500
committerUnknwon <u@gogs.io>2015-12-10 19:02:57 -0500
commit3d5d61778ac8fab981720b5f8b7fe75e2fb58434 (patch)
treed22e52c2cc8ad9fb948322252a594225cf1b71b2 /routers
parentddcc8d998c93d6e252319a82b116dbe553a919ad (diff)
downloadgitea-3d5d61778ac8fab981720b5f8b7fe75e2fb58434.tar.gz
gitea-3d5d61778ac8fab981720b5f8b7fe75e2fb58434.zip
#1938 #1374 disable password change for non-local users
Diffstat (limited to 'routers')
-rw-r--r--routers/admin/auths.go24
-rw-r--r--routers/admin/users.go2
-rw-r--r--routers/api/v1/admin/users.go2
3 files changed, 14 insertions, 14 deletions
diff --git a/routers/admin/auths.go b/routers/admin/auths.go
index baa5efe3d1..659b8fcf67 100644
--- a/routers/admin/auths.go
+++ b/routers/admin/auths.go
@@ -45,10 +45,10 @@ type AuthSource struct {
}
var authSources = []AuthSource{
- {models.LoginNames[models.LDAP], models.LDAP},
- {models.LoginNames[models.DLDAP], models.DLDAP},
- {models.LoginNames[models.SMTP], models.SMTP},
- {models.LoginNames[models.PAM], models.PAM},
+ {models.LoginNames[models.LOGIN_LDAP], models.LOGIN_LDAP},
+ {models.LoginNames[models.LOGIN_DLDAP], models.LOGIN_DLDAP},
+ {models.LoginNames[models.LOGIN_SMTP], models.LOGIN_SMTP},
+ {models.LoginNames[models.LOGIN_PAM], models.LOGIN_PAM},
}
func NewAuthSource(ctx *middleware.Context) {
@@ -56,8 +56,8 @@ func NewAuthSource(ctx *middleware.Context) {
ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminAuthentications"] = true
- ctx.Data["type"] = models.LDAP
- ctx.Data["CurTypeName"] = models.LoginNames[models.LDAP]
+ ctx.Data["type"] = models.LOGIN_LDAP
+ ctx.Data["CurTypeName"] = models.LoginNames[models.LOGIN_LDAP]
ctx.Data["smtp_auth"] = "PLAIN"
ctx.Data["is_active"] = true
ctx.Data["AuthSources"] = authSources
@@ -115,11 +115,11 @@ func NewAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
var config core.Conversion
switch models.LoginType(form.Type) {
- case models.LDAP, models.DLDAP:
+ case models.LOGIN_LDAP, models.LOGIN_DLDAP:
config = parseLDAPConfig(form)
- case models.SMTP:
+ case models.LOGIN_SMTP:
config = parseSMTPConfig(form)
- case models.PAM:
+ case models.LOGIN_PAM:
config = &models.PAMConfig{
ServiceName: form.PAMServiceName,
}
@@ -181,11 +181,11 @@ func EditAuthSourcePost(ctx *middleware.Context, form auth.AuthenticationForm) {
var config core.Conversion
switch models.LoginType(form.Type) {
- case models.LDAP, models.DLDAP:
+ case models.LOGIN_LDAP, models.LOGIN_DLDAP:
config = parseLDAPConfig(form)
- case models.SMTP:
+ case models.LOGIN_SMTP:
config = parseSMTPConfig(form)
- case models.PAM:
+ case models.LOGIN_PAM:
config = &models.PAMConfig{
ServiceName: form.PAMServiceName,
}
diff --git a/routers/admin/users.go b/routers/admin/users.go
index 5e6c3a13cc..ada0df5905 100644
--- a/routers/admin/users.go
+++ b/routers/admin/users.go
@@ -90,7 +90,7 @@ func NewUserPost(ctx *middleware.Context, form auth.AdminCrateUserForm) {
Email: form.Email,
Passwd: form.Password,
IsActive: true,
- LoginType: models.PLAIN,
+ LoginType: models.LOGIN_PLAIN,
}
if len(form.LoginType) > 0 {
diff --git a/routers/api/v1/admin/users.go b/routers/api/v1/admin/users.go
index 1252ebbf49..1bd253681b 100644
--- a/routers/api/v1/admin/users.go
+++ b/routers/api/v1/admin/users.go
@@ -43,7 +43,7 @@ func CreateUser(ctx *middleware.Context, form api.CreateUserOption) {
Email: form.Email,
Passwd: form.Password,
IsActive: true,
- LoginType: models.PLAIN,
+ LoginType: models.LOGIN_PLAIN,
}
parseLoginSource(ctx, u, form.SourceID, form.LoginName)