Merge pull request #237 from mattermost/mm-1570
fixes mm-1570 adds support for using mattermost as an OAuth client
Этот коммит содержится в:
@@ -449,7 +449,7 @@ var SecurityTab = React.createClass({
|
||||
submitPassword: function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var user = UserStore.getCurrentUser();
|
||||
var user = this.props.user;
|
||||
var currentPassword = this.state.current_password;
|
||||
var newPassword = this.state.new_password;
|
||||
var confirmPassword = this.state.confirm_password;
|
||||
@@ -513,53 +513,69 @@ var SecurityTab = React.createClass({
|
||||
var self = this;
|
||||
if (this.props.activeSection === 'password') {
|
||||
var inputs = [];
|
||||
var submit = null;
|
||||
|
||||
inputs.push(
|
||||
<div className="form-group">
|
||||
<label className="col-sm-5 control-label">Current Password</label>
|
||||
<div className="col-sm-7">
|
||||
<input className="form-control" type="password" onChange={this.updateCurrentPassword} value={this.state.current_password}/>
|
||||
if (this.props.user.auth_service === "") {
|
||||
inputs.push(
|
||||
<div className="form-group">
|
||||
<label className="col-sm-5 control-label">Current Password</label>
|
||||
<div className="col-sm-7">
|
||||
<input className="form-control" type="password" onChange={this.updateCurrentPassword} value={this.state.current_password}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
inputs.push(
|
||||
<div className="form-group">
|
||||
<label className="col-sm-5 control-label">New Password</label>
|
||||
<div className="col-sm-7">
|
||||
<input className="form-control" type="password" onChange={this.updateNewPassword} value={this.state.new_password}/>
|
||||
);
|
||||
inputs.push(
|
||||
<div className="form-group">
|
||||
<label className="col-sm-5 control-label">New Password</label>
|
||||
<div className="col-sm-7">
|
||||
<input className="form-control" type="password" onChange={this.updateNewPassword} value={this.state.new_password}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
inputs.push(
|
||||
<div className="form-group">
|
||||
<label className="col-sm-5 control-label">Retype New Password</label>
|
||||
<div className="col-sm-7">
|
||||
<input className="form-control" type="password" onChange={this.updateConfirmPassword} value={this.state.confirm_password}/>
|
||||
);
|
||||
inputs.push(
|
||||
<div className="form-group">
|
||||
<label className="col-sm-5 control-label">Retype New Password</label>
|
||||
<div className="col-sm-7">
|
||||
<input className="form-control" type="password" onChange={this.updateConfirmPassword} value={this.state.confirm_password}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
|
||||
submit = this.submitPassword;
|
||||
} else {
|
||||
inputs.push(
|
||||
<div className="form-group">
|
||||
<label className="col-sm-12">Log in occurs through GitLab. Please see your GitLab account settings page to update your password.</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
passwordSection = (
|
||||
<SettingItemMax
|
||||
title="Password"
|
||||
inputs={inputs}
|
||||
submit={this.submitPassword}
|
||||
submit={submit}
|
||||
server_error={server_error}
|
||||
client_error={password_error}
|
||||
updateSection={function(e){self.props.updateSection("");e.preventDefault();}}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
var d = new Date(this.props.user.last_password_update);
|
||||
var hour = d.getHours() % 12 ? String(d.getHours() % 12) : "12";
|
||||
var min = d.getMinutes() < 10 ? "0" + d.getMinutes() : String(d.getMinutes());
|
||||
var timeOfDay = d.getHours() >= 12 ? " pm" : " am";
|
||||
var dateStr = "Last updated " + Constants.MONTHS[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() + " at " + hour + ":" + min + timeOfDay;
|
||||
var describe;
|
||||
if (this.props.user.auth_service === "") {
|
||||
var d = new Date(this.props.user.last_password_update);
|
||||
var hour = d.getHours() % 12 ? String(d.getHours() % 12) : "12";
|
||||
var min = d.getMinutes() < 10 ? "0" + d.getMinutes() : String(d.getMinutes());
|
||||
var timeOfDay = d.getHours() >= 12 ? " pm" : " am";
|
||||
describe = "Last updated " + Constants.MONTHS[d.getMonth()] + " " + d.getDate() + ", " + d.getFullYear() + " at " + hour + ":" + min + timeOfDay;
|
||||
} else {
|
||||
describe = "Log in done through GitLab"
|
||||
}
|
||||
|
||||
passwordSection = (
|
||||
<SettingItemMin
|
||||
title="Password"
|
||||
describe={dateStr}
|
||||
describe={describe}
|
||||
updateSection={function(){self.props.updateSection("password");}}
|
||||
/>
|
||||
);
|
||||
|
||||
Ссылка в новой задаче
Block a user