diff options
Diffstat (limited to 'routers/admin/users.go')
-rw-r--r-- | routers/admin/users.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index 10ae622c32..a28db2b445 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -243,7 +243,13 @@ func EditUserPost(ctx *context.Context, form auth.AdminEditUserForm) { u.AllowGitHook = form.AllowGitHook u.AllowImportLocal = form.AllowImportLocal u.AllowCreateOrganization = form.AllowCreateOrganization - u.ProhibitLogin = form.ProhibitLogin + + // skip self Prohibit Login + if ctx.User.ID == u.ID { + u.ProhibitLogin = false + } else { + u.ProhibitLogin = form.ProhibitLogin + } if err := models.UpdateUser(u); err != nil { if models.IsErrEmailAlreadyUsed(err) { |