diff options
Diffstat (limited to 'webapp/components/claim/components/ldap_to_email.jsx')
-rw-r--r-- | webapp/components/claim/components/ldap_to_email.jsx | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/webapp/components/claim/components/ldap_to_email.jsx b/webapp/components/claim/components/ldap_to_email.jsx index ed8a314bd..a10cefd6f 100644 --- a/webapp/components/claim/components/ldap_to_email.jsx +++ b/webapp/components/claim/components/ldap_to_email.jsx @@ -2,12 +2,11 @@ // See License.txt for license information. import * as Utils from 'utils/utils.jsx'; -import * as Client from 'utils/client.jsx'; +import Client from 'utils/web_client.jsx'; import React from 'react'; import ReactDOM from 'react-dom'; import {FormattedMessage} from 'react-intl'; -import {browserHistory} from 'react-router'; export default class LDAPToEmail extends React.Component { constructor(props) { @@ -45,16 +44,13 @@ export default class LDAPToEmail extends React.Component { state.error = null; this.setState(state); - var postData = {}; - postData.email_password = password; - postData.ldap_password = ldapPassword; - postData.email = this.props.email; - postData.team_name = this.props.teamName; - - Client.ldapToEmail(postData, + Client.ldapToEmail( + this.props.email, + password, + ldapPassword, (data) => { if (data.follow_link) { - browserHistory.push(data.follow_link); + window.location.href = data.follow_link; } }, (error) => { @@ -73,6 +69,13 @@ export default class LDAPToEmail extends React.Component { formClass += ' has-error'; } + let passwordPlaceholder; + if (global.window.mm_config.LdapPasswordFieldName) { + passwordPlaceholder = global.window.mm_config.LdapPasswordFieldName; + } else { + passwordPlaceholder = Utils.localizeMessage('claim.ldap_to_email.ldapPwd', 'LDAP Password'); + } + return ( <div> <h3> @@ -100,9 +103,9 @@ export default class LDAPToEmail extends React.Component { <p> <FormattedMessage id='claim.ldap_to_email.enterLdapPwd' - defaultMessage='Enter your LDAP password for your {team} {site} email account' + defaultMessage='Enter your {ldapPassword} for your {site} email account' values={{ - team: this.props.teamDisplayName, + ldapPassword: passwordPlaceholder, site: global.window.mm_config.SiteName }} /> @@ -113,7 +116,7 @@ export default class LDAPToEmail extends React.Component { className='form-control' name='ldapPassword' ref='ldappassword' - placeholder={Utils.localizeMessage('claim.ldap_to_email.ldapPwd', 'LDAP Password')} + placeholder={passwordPlaceholder} spellCheck='false' /> </div> @@ -162,7 +165,5 @@ export default class LDAPToEmail extends React.Component { LDAPToEmail.defaultProps = { }; LDAPToEmail.propTypes = { - email: React.PropTypes.string, - teamName: React.PropTypes.string, - teamDisplayName: React.PropTypes.string + email: React.PropTypes.string }; |