summaryrefslogtreecommitdiffstats
path: root/webapp/components/admin_console/password_settings.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu97@outlook.com>2016-08-10 15:20:52 -0400
committerenahum <nahumhbl@gmail.com>2016-08-10 14:20:52 -0500
commitbd106bb4018ab71dc1bc973d562bcda3dfbb6868 (patch)
tree6a3982883c6931ffffef5b67d0f15ef3ec32e10d /webapp/components/admin_console/password_settings.jsx
parent379efb0a33d12b2540440b2a6c540265c542d97c (diff)
downloadchat-bd106bb4018ab71dc1bc973d562bcda3dfbb6868.tar.gz
chat-bd106bb4018ab71dc1bc973d562bcda3dfbb6868.tar.bz2
chat-bd106bb4018ab71dc1bc973d562bcda3dfbb6868.zip
fixed password reset salt broken (#3778)
Diffstat (limited to 'webapp/components/admin_console/password_settings.jsx')
-rw-r--r--webapp/components/admin_console/password_settings.jsx99
1 files changed, 53 insertions, 46 deletions
diff --git a/webapp/components/admin_console/password_settings.jsx b/webapp/components/admin_console/password_settings.jsx
index 20de8580f..7b312b0f4 100644
--- a/webapp/components/admin_console/password_settings.jsx
+++ b/webapp/components/admin_console/password_settings.jsx
@@ -34,28 +34,31 @@ export default class PasswordSettings extends AdminSettings {
});
// Update sample message from config settings
- let sampleErrorMsgId = 'user.settings.security.passwordError';
- if (props.config.PasswordSettings.Lowercase) {
- sampleErrorMsgId = sampleErrorMsgId + 'Lowercase';
- }
- if (props.config.PasswordSettings.Uppercase) {
- sampleErrorMsgId = sampleErrorMsgId + 'Uppercase';
- }
- if (props.config.PasswordSettings.Number) {
- sampleErrorMsgId = sampleErrorMsgId + 'Number';
- }
- if (props.config.PasswordSettings.Symbol) {
- sampleErrorMsgId = sampleErrorMsgId + 'Symbol';
+ this.sampleErrorMsg = null;
+ if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.PasswordRequirements === 'true') {
+ let sampleErrorMsgId = 'user.settings.security.passwordError';
+ if (props.config.PasswordSettings.Lowercase) {
+ sampleErrorMsgId = sampleErrorMsgId + 'Lowercase';
+ }
+ if (props.config.PasswordSettings.Uppercase) {
+ sampleErrorMsgId = sampleErrorMsgId + 'Uppercase';
+ }
+ if (props.config.PasswordSettings.Number) {
+ sampleErrorMsgId = sampleErrorMsgId + 'Number';
+ }
+ if (props.config.PasswordSettings.Symbol) {
+ sampleErrorMsgId = sampleErrorMsgId + 'Symbol';
+ }
+ this.sampleErrorMsg = (
+ <FormattedMessage
+ id={sampleErrorMsgId}
+ default='Your password must be at least {min} characters.'
+ values={{
+ min: props.config.PasswordSettings.MinimumLength
+ }}
+ />
+ );
}
- this.sampleErrorMsg = (
- <FormattedMessage
- id={sampleErrorMsgId}
- default='Your password must be at least {min} characters.'
- values={{
- min: props.config.PasswordSettings.MinimumLength
- }}
- />
- );
}
componentWillUpdate() {
@@ -94,37 +97,41 @@ export default class PasswordSettings extends AdminSettings {
}
getSampleErrorMsg() {
- if (this.props.config.PasswordSettings.MinimumLength > Constants.MAX_PASSWORD_LENGTH || this.props.config.PasswordSettings.MinimumLength < Constants.MIN_PASSWORD_LENGTH) {
+ 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 (
+ <FormattedMessage
+ id='user.settings.security.passwordMinLength'
+ default='Invalid minimum length, cannot show preview.'
+ />
+ );
+ }
+
+ let sampleErrorMsgId = 'user.settings.security.passwordError';
+ if (this.refs.lowercase.checked) {
+ sampleErrorMsgId = sampleErrorMsgId + 'Lowercase';
+ }
+ if (this.refs.uppercase.checked) {
+ sampleErrorMsgId = sampleErrorMsgId + 'Uppercase';
+ }
+ if (this.refs.number.checked) {
+ sampleErrorMsgId = sampleErrorMsgId + 'Number';
+ }
+ if (this.refs.symbol.checked) {
+ sampleErrorMsgId = sampleErrorMsgId + 'Symbol';
+ }
return (
<FormattedMessage
- id='user.settings.security.passwordMinLength'
- default='Invalid minimum length, cannot show preview.'
+ id={sampleErrorMsgId}
+ default='Your password must be at least {min} characters.'
+ values={{
+ min: this.props.config.PasswordSettings.MinimumLength
+ }}
/>
);
}
- let sampleErrorMsgId = 'user.settings.security.passwordError';
- if (this.refs.lowercase.checked) {
- sampleErrorMsgId = sampleErrorMsgId + 'Lowercase';
- }
- if (this.refs.uppercase.checked) {
- sampleErrorMsgId = sampleErrorMsgId + 'Uppercase';
- }
- if (this.refs.number.checked) {
- sampleErrorMsgId = sampleErrorMsgId + 'Number';
- }
- if (this.refs.symbol.checked) {
- sampleErrorMsgId = sampleErrorMsgId + 'Symbol';
- }
- return (
- <FormattedMessage
- id={sampleErrorMsgId}
- default='Your password must be at least {min} characters.'
- values={{
- min: this.props.config.PasswordSettings.MinimumLength
- }}
- />
- );
+ return null;
}
renderTitle() {