diff options
author | slene <vslene@gmail.com> | 2014-03-16 22:42:25 +0800 |
---|---|---|
committer | slene <vslene@gmail.com> | 2014-03-16 22:42:25 +0800 |
commit | 22f467dc7d7d4e58b48a23872fc717395e78667f (patch) | |
tree | a6feba091cc484b8da0c0b909feef039aaea5173 /routers/user/user.go | |
parent | 8c2597b5d91dc2c3546592590ef7b856b5f4d4ff (diff) | |
parent | 2fd3608388430ec30d9916fead1946bf4b2c5e4c (diff) |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'routers/user/user.go')
-rw-r--r-- | routers/user/user.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/user/user.go b/routers/user/user.go index ad84ff6c..0ff5058d 100644 --- a/routers/user/user.go +++ b/routers/user/user.go @@ -157,11 +157,11 @@ func Delete(ctx *middleware.Context) { return } - rawPasswd := ctx.Query("password") - encodedPwd, _ := models.EncodePasswd(rawPasswd) - if len(encodedPwd) == 0 || encodedPwd != ctx.User.Passwd { + tmpUser := models.User{Passwd: ctx.Query("password")} + tmpUser.EncodePasswd() + if len(tmpUser.Passwd) == 0 || tmpUser.Passwd != ctx.User.Passwd { ctx.Data["HasError"] = true - ctx.Data["ErrorMsg"] = "Your password error. Make sure you are owner of this account." + ctx.Data["ErrorMsg"] = "Password is not correct. Make sure you are owner of this account." } else { if err := models.DeleteUser(ctx.User); err != nil { ctx.Data["HasError"] = true |