Added the ability to create a team with SSO services and added the ability to turn off email sign up.

This commit is contained in:
JoramWilander
2015-08-28 08:37:55 -04:00
parent db7e8c1288
commit f5fec3a157
30 changed files with 880 additions and 342 deletions

View File

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