Disables the ability to send email invites when user creation is disabled
Этот коммит содержится в:
@@ -183,6 +183,7 @@ func getClientConfig(c *model.Config) map[string]string {
|
|||||||
|
|
||||||
props["SiteName"] = c.TeamSettings.SiteName
|
props["SiteName"] = c.TeamSettings.SiteName
|
||||||
props["EnableTeamCreation"] = strconv.FormatBool(c.TeamSettings.EnableTeamCreation)
|
props["EnableTeamCreation"] = strconv.FormatBool(c.TeamSettings.EnableTeamCreation)
|
||||||
|
props["EnableUserCreation"] = strconv.FormatBool(c.TeamSettings.EnableUserCreation)
|
||||||
props["RestrictTeamNames"] = strconv.FormatBool(*c.TeamSettings.RestrictTeamNames)
|
props["RestrictTeamNames"] = strconv.FormatBool(*c.TeamSettings.RestrictTeamNames)
|
||||||
props["EnableTeamListing"] = strconv.FormatBool(*c.TeamSettings.EnableTeamListing)
|
props["EnableTeamListing"] = strconv.FormatBool(*c.TeamSettings.EnableTeamListing)
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
firstNameErrors: {},
|
firstNameErrors: {},
|
||||||
lastNameErrors: {},
|
lastNameErrors: {},
|
||||||
emailEnabled: global.window.mm_config.SendEmailNotifications === 'true',
|
emailEnabled: global.window.mm_config.SendEmailNotifications === 'true',
|
||||||
|
userCreationEnabled: global.window.mm_config.EnableUserCreation === 'true',
|
||||||
showConfirmModal: false,
|
showConfirmModal: false,
|
||||||
isSendingEmails: false
|
isSendingEmails: false
|
||||||
};
|
};
|
||||||
@@ -252,7 +253,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
ref={'first_name' + index}
|
ref={'first_name' + index}
|
||||||
placeholder='First name'
|
placeholder='First name'
|
||||||
maxLength='64'
|
maxLength='64'
|
||||||
disabled={!this.state.emailEnabled}
|
disabled={!this.state.emailEnabled || !this.state.userCreationEnabled}
|
||||||
spellCheck='false'
|
spellCheck='false'
|
||||||
/>
|
/>
|
||||||
{firstNameError}
|
{firstNameError}
|
||||||
@@ -266,7 +267,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
ref={'last_name' + index}
|
ref={'last_name' + index}
|
||||||
placeholder='Last name'
|
placeholder='Last name'
|
||||||
maxLength='64'
|
maxLength='64'
|
||||||
disabled={!this.state.emailEnabled}
|
disabled={!this.state.emailEnabled || !this.state.userCreationEnabled}
|
||||||
spellCheck='false'
|
spellCheck='false'
|
||||||
/>
|
/>
|
||||||
{lastNameError}
|
{lastNameError}
|
||||||
@@ -285,7 +286,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
className='form-control'
|
className='form-control'
|
||||||
placeholder='email@domain.com'
|
placeholder='email@domain.com'
|
||||||
maxLength='64'
|
maxLength='64'
|
||||||
disabled={!this.state.emailEnabled}
|
disabled={!this.state.emailEnabled || !this.state.userCreationEnabled}
|
||||||
spellCheck='false'
|
spellCheck='false'
|
||||||
/>
|
/>
|
||||||
{emailError}
|
{emailError}
|
||||||
@@ -303,7 +304,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
var content = null;
|
var content = null;
|
||||||
var sendButton = null;
|
var sendButton = null;
|
||||||
|
|
||||||
if (this.state.emailEnabled) {
|
if (this.state.emailEnabled && this.state.userCreationEnabled) {
|
||||||
content = (
|
content = (
|
||||||
<div>
|
<div>
|
||||||
{serverError}
|
{serverError}
|
||||||
@@ -337,7 +338,7 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
{sendButtonLabel}
|
{sendButtonLabel}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
} else {
|
} else if (this.state.userCreationEnabled) {
|
||||||
var teamInviteLink = null;
|
var teamInviteLink = null;
|
||||||
if (currentUser && TeamStore.getCurrent().type === 'O') {
|
if (currentUser && TeamStore.getCurrent().type === 'O') {
|
||||||
var link = (
|
var link = (
|
||||||
@@ -358,10 +359,16 @@ export default class InviteMemberModal extends React.Component {
|
|||||||
|
|
||||||
content = (
|
content = (
|
||||||
<div>
|
<div>
|
||||||
<p>Email is currently disabled for your team, and email invitations cannot be sent. Contact your system administrator to enable email and email invitations.</p>
|
<p>{'Email is currently disabled for your team, and email invitations cannot be sent. Contact your system administrator to enable email and email invitations.'}</p>
|
||||||
{teamInviteLink}
|
{teamInviteLink}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
content = (
|
||||||
|
<div>
|
||||||
|
<p>{'User creation has been disabled for your team. Please ask your team administrator for details.'}</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user