From 539570a1e656122e555ed0a521d4229e87a0ff3a Mon Sep 17 00:00:00 2001 From: Simeon Keske Date: Wed, 29 Apr 2020 16:32:36 +0200 Subject: [PATCH 1/2] Don't allow registration via the web form, when AllowOnlyExternalRegistration is True --- routers/user/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/user/auth.go b/routers/user/auth.go index 9d242bcfc252e..f17dcb6f4caac 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -1038,7 +1038,7 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey //Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true - if setting.Service.DisableRegistration { + if setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration { ctx.Error(403) return } From 23cfa0e14f17fbace4d6842273ee8be2467700c4 Mon Sep 17 00:00:00 2001 From: Simeon Keske Date: Wed, 29 Apr 2020 17:24:02 +0200 Subject: [PATCH 2/2] Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true --- routers/user/auth.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/user/auth.go b/routers/user/auth.go index f17dcb6f4caac..169f3c453d8bf 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -1021,7 +1021,8 @@ func SignUp(ctx *context.Context) { ctx.Data["CaptchaType"] = setting.Service.CaptchaType ctx.Data["RecaptchaSitekey"] = setting.Service.RecaptchaSitekey - ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration + //Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true + ctx.Data["DisableRegistration"] = setting.Service.DisableRegistration || setting.Service.AllowOnlyExternalRegistration ctx.HTML(200, tplSignUp) }