summaryrefslogtreecommitdiffstats
path: root/model/config.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-07-10 01:54:25 -0700
committerCarlos Tadeu Panato Junior <ctadeu@gmail.com>2018-07-10 10:54:25 +0200
commit74e5d8ae66186a82e8afdd845a108d6a662751d7 (patch)
treefaeeee70a251b636bae0afb4e60c611e00c2cc6b /model/config.go
parent951e4ad98401e9828b9941224318f105fb15d500 (diff)
downloadchat-74e5d8ae66186a82e8afdd845a108d6a662751d7.tar.gz
chat-74e5d8ae66186a82e8afdd845a108d6a662751d7.tar.bz2
chat-74e5d8ae66186a82e8afdd845a108d6a662751d7.zip
MM-11120 Adding setting to disable email invitations and rate limiting. (#9063)
* Adding setting to disable email invitations. * Adding a setting and rate limiting for email invite sending. * Modifying email rate limit to 20/user/hour * Adding EnableEmailInvitations to client side config and command.
Diffstat (limited to 'model/config.go')
-rw-r--r--model/config.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/config.go b/model/config.go
index be940d893..1388f896f 100644
--- a/model/config.go
+++ b/model/config.go
@@ -237,9 +237,19 @@ type ServiceSettings struct {
EnableAPITeamDeletion *bool
ExperimentalEnableHardenedMode *bool
ExperimentalLimitClientConfig *bool
+ EnableEmailInvitations *bool
}
func (s *ServiceSettings) SetDefaults() {
+ if s.EnableEmailInvitations == nil {
+ // If the site URL is also not present then assume this is a clean install
+ if s.SiteURL == nil {
+ s.EnableEmailInvitations = NewBool(false)
+ } else {
+ s.EnableEmailInvitations = NewBool(true)
+ }
+ }
+
if s.SiteURL == nil {
s.SiteURL = NewString(SERVICE_SETTINGS_DEFAULT_SITE_URL)
}