<commit_before>// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import FormError from 'components/form_error.jsx';

import * as GlobalActions from 'actions/global_actions.jsx';
import {track} from 'actions/analytics_actions.jsx';

import * as Utils from 'utils/utils.jsx';
import Client from 'client/web_client.jsx';

import React from 'react';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import {browserHistory, Link} from 'react-router/es6';

import logoImage from 'images/logo.png';

export default class SignupLdap extends React.Component {
    static get propTypes() {
        return {
            location: React.PropTypes.object
        };
    }

    constructor(props) {
        super(props);

        this.handleLdapSignup = this.handleLdapSignup.bind(this);
        this.handleLdapSignupSuccess = this.handleLdapSignupSuccess.bind(this);

        this.handleLdapIdChange = this.handleLdapIdChange.bind(this);
        this.handleLdapPasswordChange = this.handleLdapPasswordChange.bind(this);

        this.state = ({
            ldapError: '',
            ldapId: '',
            ldapPassword: ''
        });
    }

    handleLdapIdChange(e) {
        e.preventDefault();

        this.setState({
            ldapId: e.target.value
        });
    }

    handleLdapPasswordChange(e) {
        e.preventDefault();

        this.setState({
            ldapPassword: e.target.value
        });
    }

    handleLdapSignup(e) {
        e.preventDefault();

        this.setState({ldapError: ''});

        Client.webLoginByLdap(<commit_msg>Fix weird typing behaviour on LDAP signup page on IE11 (#3996)<commit_after>// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.

import FormError from 'components/form_error.jsx';

import * as GlobalActions from 'actions/global_actions.jsx';
import {track} from 'actions/analytics_actions.jsx';

import * as Utils from 'utils/utils.jsx';
import Client from 'client/web_client.jsx';

import React from 'react';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import {browserHistory, Link} from 'react-router/es6';

import logoImage from 'images/logo.png';

export default class SignupLdap extends React.Component {
    static get propTypes() {
        return {
            location: React.PropTypes.object
        };
    }

    constructor(props) {
        super(props);

        this.handleLdapSignup = this.handleLdapSignup.bind(this);
        this.handleLdapSignupSuccess = this.handleLdapSignupSuccess.bind(this);

        this.handleLdapIdChange = this.handleLdapIdChange.bind(this);
        this.handleLdapPasswordChange = this.handleLdapPasswordChange.bind(this);

        this.state = ({
            ldapError: '',
            ldapId: '',
            ldapPassword: ''
        });
    }

    handleLdapIdChange(e) {
        this.setState({
            ldapId: e.target.value
        });
    }

    handleLdapPasswordChange(e) {
        this.setState({
            ldapPassword: e.target.value
        });
    }

    handleLdapSignup(e) {
        e.preventDefault();

        this.setState({ldapError: ''});

        Client.webLoginByLdap(
{'fraction_non_alphanumeric': 0.1114541525162087, 'fraction_numerical': 0.004939796233405372, 'mean_word_length': 2.7284234752589183, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5441033', 'n_tokens_mistral': 977, 'n_tokens_neox': 976, 'n_words': 195}