Skip to content

Commit 59fef7f

Browse files
committed
Add new text for reset password flash
* Forgot password should use ResetPwdCodeLives, not ActiveCodeLives * Improve documentation for different send mail functions related to password reset * Improve documentation in conf/app.ini regarding xxx_CODE_LIVE_MINUTES settings
1 parent 9e627af commit 59fef7f

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

conf/app.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ WHITELISTED_URIS =
222222
BLACKLISTED_URIS =
223223

224224
[service]
225+
; Time limit to confirm account/email registration (in multiples of 60 minutes)
225226
ACTIVE_CODE_LIVE_MINUTES = 180
227+
; Time limit to confirm forgot password reset process (in multiples of 60 minutes)
226228
RESET_PASSWD_CODE_LIVE_MINUTES = 180
227229
; User need to confirm e-mail for registration
228230
REGISTER_EMAIL_CONFIRM = false

models/mail.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func SendUserMail(c *macaron.Context, u *User, tpl base.TplName, code, subject,
6565
mailer.SendAsync(msg)
6666
}
6767

68-
// SendActivateAccountMail sends an activation mail to the user
68+
// SendActivateAccountMail sends an activation mail to the user (new user registration)
6969
func SendActivateAccountMail(c *macaron.Context, u *User) {
7070
SendUserMail(c, u, mailAuthActivate, u.GenerateActivateCode(), c.Tr("mail.activate_account"), "activate account")
7171
}
@@ -75,7 +75,7 @@ func SendResetPasswordMail(c *macaron.Context, u *User) {
7575
SendUserMail(c, u, mailAuthResetPassword, u.GenerateActivateCode(), c.Tr("mail.reset_password"), "reset password")
7676
}
7777

78-
// SendActivateEmailMail sends confirmation email.
78+
// SendActivateEmailMail sends confirmation email to confirm new email address
7979
func SendActivateEmailMail(c *macaron.Context, u *User, email *EmailAddress) {
8080
data := map[string]interface{}{
8181
"Username": u.DisplayName(),

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ forgot_password_title= Forgot Password
171171
forgot_password = Forgot password?
172172
sign_up_now = Need an account? Sign up now.
173173
confirmation_mail_sent_prompt = A new confirmation email has been sent to <b>%s</b>. Please check your inbox within the next %d hours to complete the registration process.
174+
reset_password_mail_sent_prompt = A confirmation email has been sent to <b>%s</b>. Please check your inbox within the next %d hours to complete the password reset process.
174175
active_your_account = Activate Your Account
175176
prohibit_login = Login Prohibited
176177
prohibit_login_desc = Your account is prohibited to login, please contact the site administrator.

routers/user/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ func ForgotPasswdPost(ctx *context.Context) {
913913
u, err := models.GetUserByEmail(email)
914914
if err != nil {
915915
if models.IsErrUserNotExist(err) {
916-
ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60
916+
ctx.Data["Hours"] = setting.Service.ResetPwdCodeLives / 60
917917
ctx.Data["IsResetSent"] = true
918918
ctx.HTML(200, tplForgotPassword)
919919
return
@@ -940,7 +940,7 @@ func ForgotPasswdPost(ctx *context.Context) {
940940
log.Error(4, "Set cache(MailResendLimit) fail: %v", err)
941941
}
942942

943-
ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60
943+
ctx.Data["Hours"] = setting.Service.ResetPwdCodeLives / 60
944944
ctx.Data["IsResetSent"] = true
945945
ctx.HTML(200, tplForgotPassword)
946946
}

templates/user/auth/forgot_passwd.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="ui attached segment">
1111
{{template "base/alert" .}}
1212
{{if .IsResetSent}}
13-
<p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" .Email .Hours | Str2html}}</p>
13+
<p>{{.i18n.Tr "auth.reset_password_mail_sent_prompt" .Email .Hours | Str2html}}</p>
1414
{{else if .IsResetRequest}}
1515
<div class="required inline field {{if .Err_Email}}error{{end}}">
1616
<label for="email">{{.i18n.Tr "email"}}</label>

0 commit comments

Comments
 (0)