diff options
-rw-r--r-- | api/team.go | 15 | ||||
-rw-r--r-- | config/config.json | 7 | ||||
-rw-r--r-- | docker/0.6/config_docker.json | 3 | ||||
-rw-r--r-- | utils/config.go | 21 |
4 files changed, 32 insertions, 14 deletions
diff --git a/api/team.go b/api/team.go index a331e9e34..2d60707bb 100644 --- a/api/team.go +++ b/api/team.go @@ -44,6 +44,11 @@ func signupTeam(c *Context, w http.ResponseWriter, r *http.Request) { return } + if utils.Cfg.TeamSettings.DisableTeamCreation { + c.Err = model.NewAppError("createTeamFromSignup", "Team creation has been disabled. Please ask your systems administrator for details.", "") + return + } + subjectPage := NewServerTemplatePage("signup_team_subject", c.GetSiteURL()) bodyPage := NewServerTemplatePage("signup_team_body", c.GetSiteURL()) bodyPage.Props["TourUrl"] = utils.Cfg.TeamSettings.TourLink @@ -79,6 +84,11 @@ func createTeamFromSignup(c *Context, w http.ResponseWriter, r *http.Request) { return } + if utils.Cfg.TeamSettings.DisableTeamCreation { + c.Err = model.NewAppError("createTeamFromSignup", "Team creation has been disabled. Please ask your systems administrator for details.", "") + return + } + props := model.MapFromJson(strings.NewReader(teamSignup.Data)) teamSignup.Team.Email = props["email"] teamSignup.User.Email = props["email"] @@ -169,6 +179,11 @@ func createTeam(c *Context, w http.ResponseWriter, r *http.Request) { return } + if utils.Cfg.TeamSettings.DisableTeamCreation { + c.Err = model.NewAppError("createTeam", "Team creation has been disabled. Please ask your systems administrator for details.", "") + return + } + if utils.Cfg.ServiceSettings.Mode != utils.MODE_DEV { c.Err = model.NewAppError("createTeam", "The mode does not allow network creation without a valid invite", "") return diff --git a/config/config.json b/config/config.json index f1f3ba22c..768fd9356 100644 --- a/config/config.json +++ b/config/config.json @@ -73,8 +73,8 @@ "SMTPUsername": "", "SMTPPassword": "", "SMTPServer": "", - "UseTLS": false, - "UseStartTLS": false, + "UseTLS": false, + "UseStartTLS": false, "FeedbackEmail": "", "FeedbackName": "", "ApplePushServer": "", @@ -104,6 +104,7 @@ "HelpLink": "/static/help/configure_links.html", "ReportProblemLink": "/static/help/configure_links.html", "TourLink": "/static/help/configure_links.html", - "DefaultThemeColor": "#2389D7" + "DefaultThemeColor": "#2389D7", + "DisableTeamCreation": true } } diff --git a/docker/0.6/config_docker.json b/docker/0.6/config_docker.json index 157120b99..2193a6540 100644 --- a/docker/0.6/config_docker.json +++ b/docker/0.6/config_docker.json @@ -94,6 +94,7 @@ "HelpLink": "/static/help/configure_links.html", "ReportProblemLink": "/static/help/configure_links.html", "TourLink": "/static/help/configure_links.html", - "DefaultThemeColor": "#2389D7" + "DefaultThemeColor": "#2389D7", + "DisableTeamCreation": true } } diff --git a/utils/config.go b/utils/config.go index 46daf203c..9e5de93bf 100644 --- a/utils/config.go +++ b/utils/config.go @@ -109,16 +109,17 @@ type PrivacySettings struct { } type TeamSettings struct { - MaxUsersPerTeam int - AllowPublicLink bool - AllowValetDefault bool - TermsLink string - PrivacyLink string - AboutLink string - HelpLink string - ReportProblemLink string - TourLink string - DefaultThemeColor string + MaxUsersPerTeam int + AllowPublicLink bool + AllowValetDefault bool + TermsLink string + PrivacyLink string + AboutLink string + HelpLink string + ReportProblemLink string + TourLink string + DefaultThemeColor string + DisableTeamCreation bool } type Config struct { |