summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-08-25 14:28:02 -0700
committer=Corey Hulen <corey@hulen.com>2015-08-25 14:28:02 -0700
commitd132de4400c181d69c8d560a5f1e33e95e6d8586 (patch)
treee91a297f73f2ae7dc2b4a3ee657a1081594130df
parent3ba4914b49a001fd3b8318ee9521afbb2e6ca3e4 (diff)
downloadchat-d132de4400c181d69c8d560a5f1e33e95e6d8586.tar.gz
chat-d132de4400c181d69c8d560a5f1e33e95e6d8586.tar.bz2
chat-d132de4400c181d69c8d560a5f1e33e95e6d8586.zip
Fixes PL-1 added ability to disable team creation
-rw-r--r--api/team.go15
-rw-r--r--config/config.json7
-rw-r--r--docker/0.6/config_docker.json3
-rw-r--r--utils/config.go21
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 {