// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import LoginEmail from './login_email.jsx'; import LoginLdap from './login_ldap.jsx'; import * as Utils from '../utils/utils.jsx'; import Constants from '../utils/constants.jsx'; var FormattedMessage = ReactIntl.FormattedMessage; export default class Login extends React.Component { constructor(props) { super(props); this.state = {}; } render() { const teamDisplayName = this.props.teamDisplayName; const teamName = this.props.teamName; let loginMessage = []; if (global.window.mm_config.EnableSignUpWithGitLab === 'true') { loginMessage.push( {'with GitLab'} ); } if (global.window.mm_config.EnableSignUpWithGoogle === 'true') { loginMessage.push( {'with Google Apps'} ); } const extraParam = Utils.getUrlParameter('extra'); let extraBox = ''; if (extraParam) { let msg; if (extraParam === Constants.SIGNIN_CHANGE) { msg = ' Sign-in method changed successfully'; } else if (extraParam === Constants.SIGNIN_VERIFIED) { msg = ' Email Verified'; } if (msg != null) { extraBox = (
{msg}
); } } let emailSignup; if (global.window.mm_config.EnableSignUpWithEmail === 'true') { emailSignup = ( ); } if (loginMessage.length > 0 && emailSignup) { loginMessage = (
{loginMessage}
{'or'}
); } let forgotPassword; if (emailSignup) { forgotPassword = (
); } let userSignUp = null; if (this.props.inviteId) { userSignUp = (
{`Don't have an account? `} {'Create one now'}
); } let teamSignUp = null; if (global.window.mm_config.EnableTeamCreation === 'true') { teamSignUp = (
{'Create a new team'}
); } let ldapLogin = null; if (global.window.mm_config.EnableLdap === 'true') { ldapLogin = ( ); } return (
{'Sign in to:'}

{teamDisplayName}

{'on '}{global.window.mm_config.SiteName}

{extraBox} {loginMessage} {emailSignup} {ldapLogin} {userSignUp}
{forgotPassword} {teamSignUp}
); } } Login.defaultProps = { teamName: '', teamDisplayName: '' }; Login.propTypes = { teamName: React.PropTypes.string, teamDisplayName: React.PropTypes.string, inviteId: React.PropTypes.string };