diff options
author | Unknwon <u@gogs.io> | 2015-09-17 14:57:24 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-17 14:57:24 -0400 |
commit | 9d36fc698627f290f01cd3cc5a7f4eaec7a669fd (patch) | |
tree | 603a88905e174447c1d11537577393085ec884a3 /routers/user | |
parent | 923873db85bbc53b027a3b8194c364c0e39161d4 (diff) | |
download | gitea-9d36fc698627f290f01cd3cc5a7f4eaec7a669fd.tar.gz gitea-9d36fc698627f290f01cd3cc5a7f4eaec7a669fd.zip |
finish new auth e-mails
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/auth.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go index fa48612737..bf7d8a0353 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -327,7 +327,7 @@ func ActivateEmail(ctx *middleware.Context) { } log.Trace("Email activated: %s", email.Email) - ctx.Flash.Success(ctx.Tr("settings.activate_email_success")) + ctx.Flash.Success(ctx.Tr("settings.add_email_successs")) } ctx.Redirect(setting.AppSubUrl + "/user/settings/email") @@ -351,12 +351,14 @@ func ForgotPasswdPost(ctx *middleware.Context) { ctx.Data["Title"] = ctx.Tr("auth.forgot_password") if setting.MailService == nil { - ctx.Handle(403, "user.ForgotPasswdPost", nil) + ctx.Handle(403, "ForgotPasswdPost", nil) return } ctx.Data["IsResetRequest"] = true email := ctx.Query("email") + ctx.Data["Email"] = email + u, err := models.GetUserByEmail(email) if err != nil { if models.IsErrUserNotExist(err) { @@ -374,12 +376,11 @@ func ForgotPasswdPost(ctx *middleware.Context) { return } - mailer.SendResetPasswdMail(ctx.Render, u) + mailer.SendResetPasswordMail(ctx.Context, u) if err = ctx.Cache.Put("MailResendLimit_"+u.LowerName, u.LowerName, 180); err != nil { log.Error(4, "Set cache(MailResendLimit) fail: %v", err) } - ctx.Data["Email"] = email ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60 ctx.Data["IsResetSent"] = true ctx.HTML(200, FORGOT_PASSWORD) |