summaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorJiri Vlasak <jiri.hubacek@gmail.com>2020-12-20 02:31:06 +0100
committerGitHub <noreply@github.com>2020-12-19 20:31:06 -0500
commitd7c67a9fb255cfb95876d72cd9fd79247d33f5ef (patch)
treea9b6e7721e874ecff2ec4cc3f0fbceb009f48e05 /modules/setting
parent36bd5d70cd390d59d1440b2e68bd3170d6af7ca2 (diff)
downloadgitea-d7c67a9fb255cfb95876d72cd9fd79247d33f5ef.tar.gz
gitea-d7c67a9fb255cfb95876d72cd9fd79247d33f5ef.zip
Manually approve new registration (#13083)
* Add register manual confirm settings option The new settings option is used when manually approving new registrations. * Enable manual confirmation of new registered user When manual registration confirmation is desired (by default `false`) create new user in the database that is *not active*. The user must then be activated manually. This change speeds up the process of adding new confirmed users for Gitea instances without external auth mechanism. (Currently the option is to manually create new user by admin.) * Update docs/content/doc/advanced/config-cheat-sheet.zh-cn.md Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/service.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/setting/service.go b/modules/setting/service.go
index 4d03df17a4..5e74641d27 100644
--- a/modules/setting/service.go
+++ b/modules/setting/service.go
@@ -17,6 +17,7 @@ var Service struct {
ActiveCodeLives int
ResetPwdCodeLives int
RegisterEmailConfirm bool
+ RegisterManualConfirm bool
EmailDomainWhitelist []string
DisableRegistration bool
AllowOnlyExternalRegistration bool
@@ -63,6 +64,11 @@ func newService() {
Service.ResetPwdCodeLives = sec.Key("RESET_PASSWD_CODE_LIVE_MINUTES").MustInt(180)
Service.DisableRegistration = sec.Key("DISABLE_REGISTRATION").MustBool()
Service.AllowOnlyExternalRegistration = sec.Key("ALLOW_ONLY_EXTERNAL_REGISTRATION").MustBool()
+ if !sec.Key("REGISTER_EMAIL_CONFIRM").MustBool() {
+ Service.RegisterManualConfirm = sec.Key("REGISTER_EMAIL_CONFIRM").MustBool(false)
+ } else {
+ Service.RegisterManualConfirm = false
+ }
Service.EmailDomainWhitelist = sec.Key("EMAIL_DOMAIN_WHITELIST").Strings(",")
Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!(Service.DisableRegistration || Service.AllowOnlyExternalRegistration))
Service.ShowMilestonesDashboardPage = sec.Key("SHOW_MILESTONES_DASHBOARD_PAGE").MustBool(true)