|
|
|
@@ -1425,12 +1425,16 @@ func ForgotPasswdPost(ctx *context.Context) { |
|
|
|
email := ctx.Query("email") |
|
|
|
ctx.Data["Email"] = email |
|
|
|
|
|
|
|
u, err := models.GetUserByEmail(email) |
|
|
|
u, err := models.GetUserByMainEmail(email) |
|
|
|
if err != nil { |
|
|
|
if models.IsErrUserNotExist(err) { |
|
|
|
ctx.Data["ResetPwdCodeLives"] = timeutil.MinutesToFriendly(setting.Service.ResetPwdCodeLives, ctx.Locale.Language()) |
|
|
|
ctx.Data["IsResetSent"] = true |
|
|
|
ctx.HTML(200, tplForgotPassword) |
|
|
|
ctx.Data["IsResetSent"] = false |
|
|
|
if used, _ := models.IsEmailUsed(email); used { |
|
|
|
ctx.RenderWithErr(ctx.Tr("auth.email_not_main"), tplForgotPassword, nil) |
|
|
|
} else { |
|
|
|
ctx.RenderWithErr(ctx.Tr("auth.email_not_right"), tplForgotPassword, nil) |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|