From f5fec3a157e6c9146a0c4e28dd5f70e6c066affd Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 28 Aug 2015 08:37:55 -0400 Subject: Added the ability to create a team with SSO services and added the ability to turn off email sign up. --- utils/config.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'utils/config.go') diff --git a/utils/config.go b/utils/config.go index 36301264c..36193412b 100644 --- a/utils/config.go +++ b/utils/config.go @@ -31,6 +31,7 @@ type ServiceSettings struct { UseLocalStorage bool StorageDirectory string AllowedLoginAttempts int + AllowEmailSignUp bool } type SSOSetting struct { @@ -277,5 +278,23 @@ func GetAllowedAuthServices() []string { } } + if Cfg.ServiceSettings.AllowEmailSignUp { + authServices = append(authServices, "email") + } + return authServices } + +func IsServiceAllowed(s string) bool { + if len(s) == 0 { + return false + } + + if service, ok := Cfg.SSOSettings[s]; ok { + if service.Allow { + return true + } + } + + return false +} -- cgit v1.2.3-1-g7c22