PLT-6882 Disable /invite_people when account creation is set to false (#6709)

* PLT-6882 Disable /invite_people when account creation is set to false

* Disable /invite_people when account creation or email notifications are set to false
Этот коммит содержится в:
AJ Moon
2017-06-29 07:42:33 -07:00
коммит произвёл Harrison Healey
родитель 648f333850
Коммит 84d5f314a0
2 изменённых файлов: 13 добавлений и 1 удалений

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

@@ -28,9 +28,13 @@ func (me *InvitePeopleProvider) GetTrigger() string {
}
func (me *InvitePeopleProvider) GetCommand(T goi18n.TranslateFunc) *model.Command {
autoComplete := true
if !utils.Cfg.EmailSettings.SendEmailNotifications || !utils.Cfg.TeamSettings.EnableUserCreation {
autoComplete = false
}
return &model.Command{
Trigger: CMD_INVITE_PEOPLE,
AutoComplete: true,
AutoComplete: autoComplete,
AutoCompleteDesc: T("api.command.invite_people.desc"),
AutoCompleteHint: T("api.command.invite_people.hint"),
DisplayName: T("api.command.invite_people.name"),
@@ -42,6 +46,10 @@ func (me *InvitePeopleProvider) DoCommand(args *model.CommandArgs, message strin
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command.invite_people.email_off")}
}
if !utils.Cfg.TeamSettings.EnableUserCreation {
return &model.CommandResponse{ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL, Text: args.T("api.command.invite_people.invite_off")}
}
emailList := strings.Fields(message)
for i := len(emailList) - 1; i >= 0; i-- {

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

@@ -451,6 +451,10 @@
"id": "api.command.invite_people.email_off",
"translation": "Email has not been configured, no invite(s) sent"
},
{
"id": "api.command.invite_people.invite_off",
"translation": "User creation has been disabled on this server, no invite(s) sent"
},
{
"id": "api.command.invite_people.fail",
"translation": "Encountered an error sending email invite(s)"