PLT-3261 Fix Can't create a team with GitLab if the email domain is restricted (#3379)

Этот коммит содержится в:
enahum
2016-06-21 10:49:48 -03:00
коммит произвёл Corey Hulen
родитель a0bc947356
Коммит e6fcea8459

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

@@ -300,6 +300,13 @@ func isTeamCreationAllowed(c *Context, email string) bool {
return false
}
if result := <-Srv.Store.User().GetByEmail(email); result.Err == nil {
user := result.Data.(*model.User)
if len(user.AuthService) > 0 && len(*user.AuthData) > 0 {
return true
}
}
// commas and @ signs are optional
// can be in the form of "@corp.mattermost.com, mattermost.com mattermost.org" -> corp.mattermost.com mattermost.com mattermost.org
domains := strings.Fields(strings.TrimSpace(strings.ToLower(strings.Replace(strings.Replace(utils.Cfg.TeamSettings.RestrictCreationToDomains, "@", " ", -1), ",", " ", -1))))