summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/admin_console')
-rw-r--r--webapp/components/admin_console/ldap_test_button.jsx8
-rw-r--r--webapp/components/admin_console/password_settings.jsx20
2 files changed, 15 insertions, 13 deletions
diff --git a/webapp/components/admin_console/ldap_test_button.jsx b/webapp/components/admin_console/ldap_test_button.jsx
index 082c13b1b..16a433c23 100644
--- a/webapp/components/admin_console/ldap_test_button.jsx
+++ b/webapp/components/admin_console/ldap_test_button.jsx
@@ -71,7 +71,7 @@ export default class LdapTestButton extends React.Component {
<i className='fa fa-warning'/>
<FormattedMessage
id='admin.ldap.testFailure'
- defaultMessage='LDAP Test Failure: {error}'
+ defaultMessage='AD/LDAP Test Failure: {error}'
values={{
error: this.state.fail
}}
@@ -86,7 +86,7 @@ export default class LdapTestButton extends React.Component {
<i className='fa fa-success'/>
<FormattedMessage
id='admin.ldap.testSuccess'
- defaultMessage='LDAP Test Successful'
+ defaultMessage='AD/LDAP Test Successful'
values={{
error: this.state.fail
}}
@@ -99,7 +99,7 @@ export default class LdapTestButton extends React.Component {
let helpText = (
<FormattedHTMLMessage
id='admin.ldap.testHelpText'
- defaultMessage='Tests if the Mattermost server can connect to the LDAP server specified. See log file for more detailed error messages.'
+ defaultMessage='Tests if the Mattermost server can connect to the AD/LDAP server specified. See log file for more detailed error messages.'
/>
);
@@ -115,7 +115,7 @@ export default class LdapTestButton extends React.Component {
contents = (
<FormattedMessage
id='admin.ldap.ldap_test_button'
- defaultMessage='LDAP Test'
+ defaultMessage='AD/LDAP Test'
/>
);
}
diff --git a/webapp/components/admin_console/password_settings.jsx b/webapp/components/admin_console/password_settings.jsx
index 1ebcc7707..ad805b38c 100644
--- a/webapp/components/admin_console/password_settings.jsx
+++ b/webapp/components/admin_console/password_settings.jsx
@@ -22,6 +22,8 @@ export default class PasswordSettings extends AdminSettings {
this.getSampleErrorMsg = this.getSampleErrorMsg.bind(this);
+ this.handlePasswordLengthChange = this.handlePasswordLengthChange.bind(this);
+
this.state = Object.assign(this.state, {
passwordMinimumLength: props.config.PasswordSettings.MinimumLength,
passwordLowercase: props.config.PasswordSettings.Lowercase,
@@ -54,17 +56,13 @@ export default class PasswordSettings extends AdminSettings {
id={sampleErrorMsgId}
default='Your password must be at least {min} characters.'
values={{
- min: props.config.PasswordSettings.MinimumLength
+ min: (this.state.passwordMinimumLength || Constants.MIN_PASSWORD_LENGTH)
}}
/>
);
}
}
- componentWillUpdate() {
- this.sampleErrorMsg = this.getSampleErrorMsg();
- }
-
getConfigFromState(config) {
if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.PasswordRequirements === 'true') {
config.PasswordSettings.MinimumLength = this.parseIntNonZero(this.state.passwordMinimumLength, Constants.MIN_PASSWORD_LENGTH);
@@ -96,7 +94,7 @@ export default class PasswordSettings extends AdminSettings {
};
}
- getSampleErrorMsg() {
+ getSampleErrorMsg(minLength) {
if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.PasswordRequirements === 'true') {
if (this.props.config.PasswordSettings.MinimumLength > Constants.MAX_PASSWORD_LENGTH || this.props.config.PasswordSettings.MinimumLength < Constants.MIN_PASSWORD_LENGTH) {
return (
@@ -106,7 +104,6 @@ export default class PasswordSettings extends AdminSettings {
/>
);
}
-
let sampleErrorMsgId = 'user.settings.security.passwordError';
if (this.refs.lowercase.checked) {
sampleErrorMsgId = sampleErrorMsgId + 'Lowercase';
@@ -125,7 +122,7 @@ export default class PasswordSettings extends AdminSettings {
id={sampleErrorMsgId}
default='Your password must be at least {min} characters.'
values={{
- min: this.props.config.PasswordSettings.MinimumLength
+ min: (minLength || Constants.MIN_PASSWORD_LENGTH)
}}
/>
);
@@ -134,6 +131,11 @@ export default class PasswordSettings extends AdminSettings {
return null;
}
+ handlePasswordLengthChange(id, value) {
+ this.sampleErrorMsg = this.getSampleErrorMsg(value);
+ this.handleChange(id, value);
+ }
+
renderTitle() {
return (
<h3>
@@ -193,7 +195,7 @@ export default class PasswordSettings extends AdminSettings {
/>
}
value={this.state.passwordMinimumLength}
- onChange={this.handleChange}
+ onChange={this.handlePasswordLengthChange}
/>
<Setting
label={