summaryrefslogtreecommitdiffstats
path: root/modules
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 /modules
parente74055878f21c35e49faf2d17abb05e03bfe32e8 (diff)
downloadgitea-1546458f7df4a4f0e77b7ae5cb65baed6feae394.tar.gz
gitea-1546458f7df4a4f0e77b7ae5cb65baed6feae394.zip
issue-2768: added new option allow_only_external_registration (#3910)
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/user_form.go1
-rw-r--r--modules/setting/setting.go4
2 files changed, 4 insertions, 1 deletions
diff --git a/modules/auth/user_form.go b/modules/auth/user_form.go
index 956ebd944b..5906abcd1d 100644
--- a/modules/auth/user_form.go
+++ b/modules/auth/user_form.go
@@ -44,6 +44,7 @@ type InstallForm struct {
EnableOpenIDSignIn bool
EnableOpenIDSignUp bool
DisableRegistration bool
+ AllowOnlyExternalRegistration bool
EnableCaptcha bool
RequireSignInView bool
DefaultKeepEmailPrivate bool
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index af1a282429..9f20d955cc 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -1143,6 +1143,7 @@ var Service struct {
ResetPwdCodeLives int
RegisterEmailConfirm bool
DisableRegistration bool
+ AllowOnlyExternalRegistration bool
ShowRegistrationButton bool
RequireSignInView bool
EnableNotifyMail bool
@@ -1168,7 +1169,8 @@ func newService() {
Service.ActiveCodeLives = sec.Key("ACTIVE_CODE_LIVE_MINUTES").MustInt(180)
Service.ResetPwdCodeLives = sec.Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180)
Service.DisableRegistration = sec.Key("DISABLE_REGISTRATION").MustBool()
- Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!Service.DisableRegistration)
+ Service.AllowOnlyExternalRegistration = sec.Key("ALLOW_ONLY_EXTERNAL_REGISTRATION").MustBool()
+ Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!(Service.DisableRegistration || Service.AllowOnlyExternalRegistration))
Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool()
Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()