diff options
author | gima <gima@iki.fi> | 2014-07-18 05:11:40 +0300 |
---|---|---|
committer | gima <gima@iki.fi> | 2014-07-18 05:30:57 +0300 |
commit | 5a97cc69edf47cec6005c58bc2e2d385e11229a6 (patch) | |
tree | 46aa113805d406e3a2ab883d175df8cf3a2546ec /routers/admin | |
parent | 6418caf23a623e45978abdd25ed32a29b12ad868 (diff) |
Make possible for administrators to change user's password (fix proposal for #290)
Diffstat (limited to 'routers/admin')
-rw-r--r-- | routers/admin/user.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/admin/user.go b/routers/admin/user.go index cf99db2b..2d22cfdd 100644 --- a/routers/admin/user.go +++ b/routers/admin/user.go @@ -134,6 +134,13 @@ func EditUserPost(ctx *middleware.Context, params martini.Params, form auth.Admi return } + if (form.Passwd != "") { + u.Passwd = form.Passwd + u.Rands = models.GetUserSalt() + u.Salt = models.GetUserSalt() + u.EncodePasswd() + } + u.Email = form.Email u.Website = form.Website u.Location = form.Location |