aboutsummaryrefslogtreecommitdiffstats
path: root/routers/user/auth.go
diff options
context:
space:
mode:
authorFabioFortini <FabioFortini@users.noreply.github.com>2018-05-13 09:51:16 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2018-05-13 15:51:16 +0800
commit1546458f7df4a4f0e77b7ae5cb65baed6feae394 (patch)
treeaae745f69c31c4b9b808f901ca6dcc0fbd47857a /routers/user/auth.go
parente74055878f21c35e49faf2d17abb05e03bfe32e8 (diff)
downloadgitea-1546458f7df4a4f0e77b7ae5cb65baed6feae394.tar.gz
gitea-1546458f7df4a4f0e77b7ae5cb65baed6feae394.zip
issue-2768: added new option allow_only_external_registration (#3910)
Diffstat (limited to 'routers/user/auth.go')
-rw-r--r--routers/user/auth.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go
index 2a5cb8e4b2..c8e1ada0db 100644
--- a/routers/user/auth.go
+++ b/routers/user/auth.go
@@ -741,7 +741,8 @@ func SignUpPost(ctx *context.Context, cpt *captcha.Captcha, form auth.RegisterFo
ctx.Data["EnableCaptcha"] = setting.Service.EnableCaptcha
- if setting.Service.DisableRegistration {
+ //Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
+ if !setting.Service.ShowRegistrationButton {
ctx.Error(403)
return
}