1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Merge pull request #2823 from zacheryph/feature/local-only-password-reset

Prevent `Forgot Password` for non local users
This commit is contained in:
Unknwon
2016-03-14 16:44:05 -04:00
2 changed files with 7 additions and 0 deletions

View File

@@ -343,6 +343,12 @@ func ForgotPasswdPost(ctx *context.Context) {
return
}
if !u.IsLocal() {
ctx.Data["Err_Email"] = true
ctx.RenderWithErr(ctx.Tr("auth.non_local_account"), FORGOT_PASSWORD, nil)
return
}
if ctx.Cache.IsExist("MailResendLimit_" + u.LowerName) {
ctx.Data["ResendLimited"] = true
ctx.HTML(200, FORGOT_PASSWORD)