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
|
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())
|
subjectPage := NewServerTemplatePage("signup_team_subject", c.GetSiteURL())
|
||||||
bodyPage := NewServerTemplatePage("signup_team_body", c.GetSiteURL())
|
bodyPage := NewServerTemplatePage("signup_team_body", c.GetSiteURL())
|
||||||
bodyPage.Props["TourUrl"] = utils.Cfg.TeamSettings.TourLink
|
bodyPage.Props["TourUrl"] = utils.Cfg.TeamSettings.TourLink
|
||||||
@@ -79,6 +84,11 @@ func createTeamFromSignup(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
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))
|
props := model.MapFromJson(strings.NewReader(teamSignup.Data))
|
||||||
teamSignup.Team.Email = props["email"]
|
teamSignup.Team.Email = props["email"]
|
||||||
teamSignup.User.Email = props["email"]
|
teamSignup.User.Email = props["email"]
|
||||||
@@ -169,6 +179,11 @@ func createTeam(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
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 {
|
if utils.Cfg.ServiceSettings.Mode != utils.MODE_DEV {
|
||||||
c.Err = model.NewAppError("createTeam", "The mode does not allow network creation without a valid invite", "")
|
c.Err = model.NewAppError("createTeam", "The mode does not allow network creation without a valid invite", "")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -73,8 +73,8 @@
|
|||||||
"SMTPUsername": "",
|
"SMTPUsername": "",
|
||||||
"SMTPPassword": "",
|
"SMTPPassword": "",
|
||||||
"SMTPServer": "",
|
"SMTPServer": "",
|
||||||
"UseTLS": false,
|
"UseTLS": false,
|
||||||
"UseStartTLS": false,
|
"UseStartTLS": false,
|
||||||
"FeedbackEmail": "",
|
"FeedbackEmail": "",
|
||||||
"FeedbackName": "",
|
"FeedbackName": "",
|
||||||
"ApplePushServer": "",
|
"ApplePushServer": "",
|
||||||
@@ -104,6 +104,7 @@
|
|||||||
"HelpLink": "/static/help/configure_links.html",
|
"HelpLink": "/static/help/configure_links.html",
|
||||||
"ReportProblemLink": "/static/help/configure_links.html",
|
"ReportProblemLink": "/static/help/configure_links.html",
|
||||||
"TourLink": "/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",
|
"HelpLink": "/static/help/configure_links.html",
|
||||||
"ReportProblemLink": "/static/help/configure_links.html",
|
"ReportProblemLink": "/static/help/configure_links.html",
|
||||||
"TourLink": "/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 {
|
type TeamSettings struct {
|
||||||
MaxUsersPerTeam int
|
MaxUsersPerTeam int
|
||||||
AllowPublicLink bool
|
AllowPublicLink bool
|
||||||
AllowValetDefault bool
|
AllowValetDefault bool
|
||||||
TermsLink string
|
TermsLink string
|
||||||
PrivacyLink string
|
PrivacyLink string
|
||||||
AboutLink string
|
AboutLink string
|
||||||
HelpLink string
|
HelpLink string
|
||||||
ReportProblemLink string
|
ReportProblemLink string
|
||||||
TourLink string
|
TourLink string
|
||||||
DefaultThemeColor string
|
DefaultThemeColor string
|
||||||
|
DisableTeamCreation bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user