Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not send activation email if manual confirm is set #19119

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ register_helper_msg = Already have an account? Sign in now!
social_register_helper_msg = Already have an account? Link it now!
disable_register_prompt = Registration is disabled. Please contact your site administrator.
disable_register_mail = Email confirmation for registration is disabled.
manual_activation_only = Contact your site administrator to complete activation.
remember_me = Remember this Device
forgot_password_title= Forgot Password
forgot_password = Forgot password?
Expand Down
6 changes: 6 additions & 0 deletions routers/web/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,12 @@ func handleUserCreated(ctx *context.Context, u *user_model.User, gothUser *goth.

// Send confirmation email
if !u.IsActive && u.ID > 1 {
if setting.Service.RegisterManualConfirm {
ctx.Data["ManualActivationOnly"] = true
ctx.HTML(http.StatusOK, TplActivate)
return
}

mailer.SendActivateAccountMail(ctx.Locale, u)

ctx.Data["IsSendRegisterMail"] = true
Expand Down
2 changes: 2 additions & 0 deletions templates/user/auth/activate.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<p>{{.i18n.Tr "auth.confirmation_mail_sent_prompt" (.Email|Escape) .ActiveCodeLives | Str2html}}</p>
{{else if .IsActivateFailed}}
<p>{{.i18n.Tr "auth.invalid_code"}}</p>
{{else if .ManualActivationOnly}}
<p class="center">{{.i18n.Tr "auth.manual_activation_only"}}</p>
{{else}}
<p>{{.i18n.Tr "auth.has_unconfirmed_mail" (.SignedUser.Name|Escape) (.SignedUser.Email|Escape) | Str2html}}</p>
<div class="ui divider"></div>
Expand Down