Browse Source

Only set the user password if the password field would have been shown (#12980)

POSTing to /admin/users/:id should only set the password if the the user
IsLocal or IsOauth2

Fix #12952

Signed-off-by: Andrew Thornton <art27@cantab.net>
pull/1050/head
zeripath 3 weeks ago
committed by GitHub
parent
commit
1bcf1ad643
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/admin/users.go

+ 1
- 1
routers/admin/users.go View File

@@ -224,7 +224,7 @@ func EditUserPost(ctx *context.Context, form auth.AdminEditUserForm) {
}
}

if len(form.Password) > 0 {
if len(form.Password) > 0 && (u.IsLocal() || u.IsOAuth2()) {
var err error
if len(form.Password) < setting.MinPasswordLength {
ctx.Data["Err_Password"] = true


Loading…
Cancel
Save