Merge pull request #2566 from mattermost/plt-2350
PLT-2350 Added LDAP to signup page
Этот коммит содержится в:
@@ -67,7 +67,7 @@ export function initialize() {
|
|||||||
connectFailCount = connectFailCount + 1;
|
connectFailCount = connectFailCount + 1;
|
||||||
|
|
||||||
if (connectFailCount > MAX_WEBSOCKET_FAILS) {
|
if (connectFailCount > MAX_WEBSOCKET_FAILS) {
|
||||||
ErrorStore.storeLastError(Utils.localizeMessage('channel_loader.socketError', 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.'));
|
ErrorStore.storeLastError({message: Utils.localizeMessage('channel_loader.socketError', 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.')});
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorStore.setConnectionErrorCount(connectFailCount);
|
ErrorStore.setConnectionErrorCount(connectFailCount);
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import ReactDOM from 'react-dom';
|
import LoadingScreen from 'components/loading_screen.jsx';
|
||||||
|
import LoginLdap from 'components/login_ldap.jsx';
|
||||||
|
|
||||||
|
import BrowserStore from 'stores/browser_store.jsx';
|
||||||
|
import UserStore from 'stores/user_store.jsx';
|
||||||
|
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
import * as Client from 'utils/client.jsx';
|
import * as Client from 'utils/client.jsx';
|
||||||
import UserStore from 'stores/user_store.jsx';
|
|
||||||
import BrowserStore from 'stores/browser_store.jsx';
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
import LoadingScreen from 'components/loading_screen.jsx';
|
|
||||||
|
|
||||||
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
||||||
import {browserHistory, Link} from 'react-router';
|
import {browserHistory, Link} from 'react-router';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import ReactDOM from 'react-dom';
|
||||||
|
|
||||||
import logoImage from 'images/logo.png';
|
import logoImage from 'images/logo.png';
|
||||||
|
|
||||||
@@ -314,7 +317,7 @@ class SignupUserComplete extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
var signupMessage = [];
|
let signupMessage = [];
|
||||||
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
|
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
|
||||||
signupMessage.push(
|
signupMessage.push(
|
||||||
<a
|
<a
|
||||||
@@ -351,7 +354,22 @@ class SignupUserComplete extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
var emailSignup;
|
let ldapSignup;
|
||||||
|
if (global.window.mm_config.EnableLdap === 'true' && global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.LDAP) {
|
||||||
|
ldapSignup = (
|
||||||
|
<div className='inner__content'>
|
||||||
|
<h5><strong>
|
||||||
|
<FormattedMessage
|
||||||
|
id='signup_user_completed.withLdap'
|
||||||
|
defaultMessage='With your LDAP credentials'
|
||||||
|
/>
|
||||||
|
</strong></h5>
|
||||||
|
<LoginLdap teamName={this.state.teamName}/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
let emailSignup;
|
||||||
if (global.window.mm_config.EnableSignUpWithEmail === 'true') {
|
if (global.window.mm_config.EnableSignUpWithEmail === 'true') {
|
||||||
emailSignup = (
|
emailSignup = (
|
||||||
<div>
|
<div>
|
||||||
@@ -397,24 +415,24 @@ class SignupUserComplete extends React.Component {
|
|||||||
{passwordError}
|
{passwordError}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p className='margin--extra'>
|
||||||
|
<button
|
||||||
|
type='submit'
|
||||||
|
onClick={this.handleSubmit}
|
||||||
|
className='btn-primary btn'
|
||||||
|
>
|
||||||
|
<FormattedMessage
|
||||||
|
id='signup_user_completed.create'
|
||||||
|
defaultMessage='Create Account'
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p className='margin--extra'>
|
|
||||||
<button
|
|
||||||
type='submit'
|
|
||||||
onClick={this.handleSubmit}
|
|
||||||
className='btn-primary btn'
|
|
||||||
>
|
|
||||||
<FormattedMessage
|
|
||||||
id='signup_user_completed.create'
|
|
||||||
defaultMessage='Create Account'
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (signupMessage.length > 0 && emailSignup) {
|
if (signupMessage.length > 0 && (emailSignup || ldapSignup)) {
|
||||||
signupMessage = (
|
signupMessage = (
|
||||||
<div>
|
<div>
|
||||||
{signupMessage}
|
{signupMessage}
|
||||||
@@ -428,7 +446,21 @@ class SignupUserComplete extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (signupMessage.length === 0 && !emailSignup) {
|
if (ldapSignup && emailSignup) {
|
||||||
|
ldapSignup = (
|
||||||
|
<div>
|
||||||
|
{ldapSignup}
|
||||||
|
<div className='or__container'>
|
||||||
|
<FormattedMessage
|
||||||
|
id='signup_user_completed.or'
|
||||||
|
defaultMessage='or'
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (signupMessage.length === 0 && !emailSignup && !ldapSignup) {
|
||||||
emailSignup = (
|
emailSignup = (
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
@@ -449,7 +481,7 @@ class SignupUserComplete extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div className='col-sm-12'>
|
<div className='col-sm-12'>
|
||||||
<div className='signup-team__container padding--less'>
|
<div className='signup-team__container padding--less'>
|
||||||
<form>
|
<div>
|
||||||
<img
|
<img
|
||||||
className='signup-team-logo'
|
className='signup-team-logo'
|
||||||
src={logoImage}
|
src={logoImage}
|
||||||
@@ -477,9 +509,10 @@ class SignupUserComplete extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</h4>
|
</h4>
|
||||||
{signupMessage}
|
{signupMessage}
|
||||||
|
{ldapSignup}
|
||||||
{emailSignup}
|
{emailSignup}
|
||||||
{serverError}
|
{serverError}
|
||||||
</form>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user