diff options
author | zeripath <art27@cantab.net> | 2022-03-19 14:20:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-19 14:20:42 +0000 |
commit | 5bb0c92b6cb09945d9324dbaf286d2b1fb65dd58 (patch) | |
tree | 2107a9c4f7272644b6dacff0dd7729e1ca5ade50 /routers/web | |
parent | c1e6be47d79408948e1c235be882f1792230efa1 (diff) | |
download | gitea-5bb0c92b6cb09945d9324dbaf286d2b1fb65dd58.tar.gz gitea-5bb0c92b6cb09945d9324dbaf286d2b1fb65dd58.zip |
Do not send activation email if manual confirm is set (#19119) (#19122)
Backport #19119
If the mailer is configured then even if Manual confirm is set an activation email
is still being sent because `handleUserCreated` is not checking for this case.
Fix #17263
Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/web')
-rw-r--r-- | routers/web/auth/auth.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index 206a0b7261..e0a2776926 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -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 |