Skip to content

Commit 33738ff

Browse files
authored
Don't allow registration via the web form, when AllowOnlyExternalRegistration is True (#11248)
* Don't allow registration via the web form, when AllowOnlyExternalRegistration is True * Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
1 parent 1bf9e44 commit 33738ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

routers/user/auth.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,8 @@ func SignUp(ctx *context.Context) {
10211021
ctx.Data["CaptchaType"] = setting.Service.CaptchaType
10221022
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
10231023

1024-
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration
1024+
//Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
1025+
ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration
10251026

10261027
ctx.HTML(200, tplSignUp)
10271028
}
@@ -1038,7 +1039,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
10381039
ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey
10391040

10401041
//Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
1041-
if setting.Service.DisableRegistration {
1042+
if setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration {
10421043
ctx.Error(403)
10431044
return
10441045
}

0 commit comments

Comments
 (0)