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.
Этот коммит содержится в:
Christopher Speller
2018-07-10 01:54:25 -07:00
коммит произвёл Carlos Tadeu Panato Junior
родитель 951e4ad984
Коммит 74e5d8ae66
10 изменённых файлов: 100 добавлений и 6 удалений

Просмотреть файл

@@ -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)
}