diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/admin/users.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index 2bbf13b92d..4f57407a2a 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -168,6 +168,7 @@ func EditUserPost(ctx *middleware.Context, form auth.AdminEditUserForm) { ctx.Handle(500, "GetUserById", err) return } + ctx.Data["User"] = u if ctx.HasError() { ctx.HTML(200, USER_EDIT) @@ -175,8 +176,8 @@ func EditUserPost(ctx *middleware.Context, form auth.AdminEditUserForm) { } // FIXME: need password length check - if len(form.Passwd) > 0 { - u.Passwd = form.Passwd + if len(form.Password) > 0 { + u.Passwd = form.Password u.Salt = models.GetUserSalt() u.EncodePasswd() } @@ -193,8 +194,6 @@ func EditUserPost(ctx *middleware.Context, form auth.AdminEditUserForm) { u.IsAdmin = form.Admin u.AllowGitHook = form.AllowGitHook - ctx.Data["User"] = u - if err := models.UpdateUser(u); err != nil { if err == models.ErrEmailAlreadyUsed { ctx.Data["Err_Email"] = true |