From d8bd57901e33a7057e26e782e295099ffcc0da89 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 6 Sep 2017 23:04:13 -0700 Subject: Removing webapp --- .../components/admin_console/password_settings.jsx | 281 --------------------- 1 file changed, 281 deletions(-) delete mode 100644 webapp/components/admin_console/password_settings.jsx (limited to 'webapp/components/admin_console/password_settings.jsx') diff --git a/webapp/components/admin_console/password_settings.jsx b/webapp/components/admin_console/password_settings.jsx deleted file mode 100644 index 6f39269c0..000000000 --- a/webapp/components/admin_console/password_settings.jsx +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import React from 'react'; -import AdminSettings from './admin_settings.jsx'; -import {FormattedMessage} from 'react-intl'; -import SettingsGroup from './settings_group.jsx'; -import TextSetting from './text_setting.jsx'; -import Setting from './setting.jsx'; -import * as Utils from 'utils/utils.jsx'; -import Constants from 'utils/constants.jsx'; - -export default class PasswordSettings extends AdminSettings { - constructor(props) { - super(props); - - this.getConfigFromState = this.getConfigFromState.bind(this); - - this.renderSettings = this.renderSettings.bind(this); - - this.getSampleErrorMsg = this.getSampleErrorMsg.bind(this); - - this.handlePasswordLengthChange = this.handlePasswordLengthChange.bind(this); - this.handleCheckboxChange = this.handleCheckboxChange.bind(this); - - this.state = Object.assign(this.state, { - passwordMinimumLength: props.config.PasswordSettings.MinimumLength, - passwordLowercase: props.config.PasswordSettings.Lowercase, - passwordNumber: props.config.PasswordSettings.Number, - passwordUppercase: props.config.PasswordSettings.Uppercase, - passwordSymbol: props.config.PasswordSettings.Symbol, - maximumLoginAttempts: props.config.ServiceSettings.MaximumLoginAttempts - }); - - // Update sample message from config settings - 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 += 'Lowercase'; - } - if (props.config.PasswordSettings.Uppercase) { - sampleErrorMsgId += 'Uppercase'; - } - if (props.config.PasswordSettings.Number) { - sampleErrorMsgId += 'Number'; - } - if (props.config.PasswordSettings.Symbol) { - sampleErrorMsgId += 'Symbol'; - } - this.sampleErrorMsg = ( - - ); - } - } - - 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); - config.PasswordSettings.Lowercase = this.refs.lowercase.checked; - config.PasswordSettings.Uppercase = this.refs.uppercase.checked; - config.PasswordSettings.Number = this.refs.number.checked; - config.PasswordSettings.Symbol = this.refs.symbol.checked; - } - - config.ServiceSettings.MaximumLoginAttempts = this.parseIntNonZero(this.state.maximumLoginAttempts); - - return config; - } - - getStateFromConfig(config) { - return { - passwordMinimumLength: config.PasswordSettings.MinimumLength, - passwordLowercase: config.PasswordSettings.Lowercase, - passwordNumber: config.PasswordSettings.Number, - passwordUppercase: config.PasswordSettings.Uppercase, - passwordSymbol: config.PasswordSettings.Symbol, - maximumLoginAttempts: config.ServiceSettings.MaximumLoginAttempts - }; - } - - 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 ( - - ); - } - let sampleErrorMsgId = 'user.settings.security.passwordError'; - if (this.refs.lowercase.checked) { - sampleErrorMsgId += 'Lowercase'; - } - if (this.refs.uppercase.checked) { - sampleErrorMsgId += 'Uppercase'; - } - if (this.refs.number.checked) { - sampleErrorMsgId += 'Number'; - } - if (this.refs.symbol.checked) { - sampleErrorMsgId += 'Symbol'; - } - return ( - - ); - } - - return null; - } - - handlePasswordLengthChange(id, value) { - this.sampleErrorMsg = this.getSampleErrorMsg(value); - this.handleChange(id, value); - } - - handleCheckboxChange(id, value) { - this.sampleErrorMsg = this.getSampleErrorMsg(this.state.passwordMinimumLength); - this.handleChange(id, value); - } - - renderTitle() { - return ( - - ); - } - - renderSettings() { - let passwordSettings = null; - if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.PasswordRequirements === 'true') { - passwordSettings = ( -
- - } - placeholder={Utils.localizeMessage('admin.password.minimumLengthExample', 'Ex "5"')} - helpText={ - - } - value={this.state.passwordMinimumLength} - onChange={this.handlePasswordLengthChange} - /> - - } - > -
- -
-
- -
-
- -
-
- -
-
-
- -
- {this.sampleErrorMsg} -
-
-
- ); - } - - return ( - - {passwordSettings} - - } - placeholder={Utils.localizeMessage('admin.service.attemptExample', 'Ex "10"')} - helpText={ - - } - value={this.state.maximumLoginAttempts} - onChange={this.handleChange} - /> - - ); - } -} -- cgit v1.2.3-1-g7c22