Fixes PL-1 added ability to disable team creation
Этот коммит содержится в:
15
api/team.go
15
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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user