Merge branch 'release-3.2' into 'master'
Этот коммит содержится в:
14
api/user.go
14
api/user.go
@@ -455,8 +455,8 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
if result := <-Srv.Store.User().Get(id); result.Err != nil {
|
if result := <-Srv.Store.User().Get(id); result.Err != nil {
|
||||||
c.LogAuditWithUserId(user.Id, "failure")
|
c.LogAuditWithUserId(user.Id, "failure")
|
||||||
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, result.Err.Error())
|
c.Err = result.Err
|
||||||
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
|
c.Err.StatusCode = http.StatusBadRequest
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
user = result.Data.(*model.User)
|
user = result.Data.(*model.User)
|
||||||
@@ -466,8 +466,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
if user, err = getUserForLogin(loginId, ldapOnly); err != nil {
|
if user, err = getUserForLogin(loginId, ldapOnly); err != nil {
|
||||||
c.LogAudit("failure")
|
c.LogAudit("failure")
|
||||||
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error())
|
c.Err = err
|
||||||
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -477,12 +476,7 @@ func login(c *Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
// and then authenticate them
|
// and then authenticate them
|
||||||
if user, err = authenticateUser(user, password, mfaToken); err != nil {
|
if user, err = authenticateUser(user, password, mfaToken); err != nil {
|
||||||
c.LogAuditWithUserId(user.Id, "failure")
|
c.LogAuditWithUserId(user.Id, "failure")
|
||||||
//c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, err.Error())
|
c.Err = err
|
||||||
if err.Id == "api.user.login.not_verified.app_error" {
|
|
||||||
c.Err = err
|
|
||||||
} else {
|
|
||||||
c.Err = model.NewLocAppError("login", "api.user.login.invalid_credentials", nil, "")
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.channel.add_user.to.channel.failed.deleted.app_error",
|
"id": "api.channel.add_user.to.channel.failed.deleted.app_error",
|
||||||
"translation": "Failed to add user to channel because they have been removed from the team."
|
"translation": "Fehler beim Hinzufügen des Benutzers zum Kanal, da dieser aus dem Team entfernt worden ist."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.channel.add_user_to_channel.deleted.app_error",
|
"id": "api.channel.add_user_to_channel.deleted.app_error",
|
||||||
|
|||||||
@@ -1761,7 +1761,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.user.login.invalid_credentials",
|
"id": "api.user.login.invalid_credentials",
|
||||||
"translation": "Your login credentials are incorrect."
|
"translation": "User ID or password incorrect."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.user.login.not_provided.app_error",
|
"id": "api.user.login.not_provided.app_error",
|
||||||
|
|||||||
@@ -165,7 +165,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.channel.add_user.to.channel.failed.deleted.app_error",
|
"id": "api.channel.add_user.to.channel.failed.deleted.app_error",
|
||||||
"translation": "Failed to add user to channel because they have been removed from the team."
|
"translation": "Error al agregar el usuario al canal porque ha sido removido del equipo."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "api.channel.add_user_to_channel.deleted.app_error",
|
"id": "api.channel.add_user_to_channel.deleted.app_error",
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ export default class FileUploadSetting extends Setting {
|
|||||||
uploadingText: React.PropTypes.node,
|
uploadingText: React.PropTypes.node,
|
||||||
onSubmit: React.PropTypes.func.isRequired,
|
onSubmit: React.PropTypes.func.isRequired,
|
||||||
disabled: React.PropTypes.bool,
|
disabled: React.PropTypes.bool,
|
||||||
fileType: React.PropTypes.string.isRequired
|
fileType: React.PropTypes.string.isRequired,
|
||||||
|
error: React.PropTypes.string
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +30,8 @@ export default class FileUploadSetting extends Setting {
|
|||||||
this.handleSubmit = this.handleSubmit.bind(this);
|
this.handleSubmit = this.handleSubmit.bind(this);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
fileName: null
|
fileName: null,
|
||||||
|
serverError: props.error
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,28 +23,18 @@ export default class RemoveFileSetting extends Setting {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.handleRemove = this.handleRemove.bind(this);
|
this.handleRemove = this.handleRemove.bind(this);
|
||||||
|
|
||||||
this.state = {
|
|
||||||
serverError: null
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRemove(e) {
|
handleRemove(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
$(this.refs.remove_button).button('loading');
|
$(this.refs.remove_button).button('loading');
|
||||||
this.props.onSubmit(this.props.id, (error) => {
|
this.props.onSubmit(this.props.id, () => {
|
||||||
$(this.refs.remove_button).button('reset');
|
$(this.refs.remove_button).button('reset');
|
||||||
this.setState({serverError: error});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let serverError;
|
|
||||||
if (this.state.serverError) {
|
|
||||||
serverError = <div className='form-group has-error'><label className='control-label'>{this.state.serverError}</label></div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Setting
|
<Setting
|
||||||
label={this.props.label}
|
label={this.props.label}
|
||||||
@@ -64,7 +54,6 @@ export default class RemoveFileSetting extends Setting {
|
|||||||
>
|
>
|
||||||
{this.props.removeButtonText}
|
{this.props.removeButtonText}
|
||||||
</button>
|
</button>
|
||||||
{serverError}
|
|
||||||
</div>
|
</div>
|
||||||
</Setting>
|
</Setting>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export default class SamlSettings extends AdminSettings {
|
|||||||
() => {
|
() => {
|
||||||
const fileName = file.name;
|
const fileName = file.name;
|
||||||
this.handleChange(id, fileName);
|
this.handleChange(id, fileName);
|
||||||
this.setState({[id]: fileName});
|
this.setState({[id]: fileName, [`${id}Error`]: null});
|
||||||
if (callback && typeof callback === 'function') {
|
if (callback && typeof callback === 'function') {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
@@ -94,12 +94,13 @@ export default class SamlSettings extends AdminSettings {
|
|||||||
this.state[id],
|
this.state[id],
|
||||||
() => {
|
() => {
|
||||||
this.handleChange(id, '');
|
this.handleChange(id, '');
|
||||||
this.setState({[id]: null});
|
this.setState({[id]: null, [`${id}Error`]: null});
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
if (callback && typeof callback === 'function') {
|
if (callback && typeof callback === 'function') {
|
||||||
callback(error.message);
|
callback();
|
||||||
}
|
}
|
||||||
|
this.setState({[id]: null, [`${id}Error`]: error.message});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -168,6 +169,7 @@ export default class SamlSettings extends AdminSettings {
|
|||||||
disabled={!this.state.enable}
|
disabled={!this.state.enable}
|
||||||
fileType='.crt,.cer'
|
fileType='.crt,.cer'
|
||||||
onSubmit={this.uploadCertificate}
|
onSubmit={this.uploadCertificate}
|
||||||
|
error={this.state.idpCertificateFileError}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -215,6 +217,7 @@ export default class SamlSettings extends AdminSettings {
|
|||||||
disabled={!this.state.enable || !this.state.encrypt}
|
disabled={!this.state.enable || !this.state.encrypt}
|
||||||
fileType='.key'
|
fileType='.key'
|
||||||
onSubmit={this.uploadCertificate}
|
onSubmit={this.uploadCertificate}
|
||||||
|
error={this.state.privateKeyFileError}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -262,6 +265,7 @@ export default class SamlSettings extends AdminSettings {
|
|||||||
disabled={!this.state.enable || !this.state.encrypt}
|
disabled={!this.state.enable || !this.state.encrypt}
|
||||||
fileType='.crt,.cer'
|
fileType='.crt,.cer'
|
||||||
onSubmit={this.uploadCertificate}
|
onSubmit={this.uploadCertificate}
|
||||||
|
error={this.state.publicCertificateFileError}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,6 +260,10 @@ export default class PostViewController extends React.Component {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nextState.emojis !== this.state.emojis) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,12 +54,13 @@ class EmojiStore extends EventEmitter {
|
|||||||
this.addCustomEmoji(emoji);
|
this.addCustomEmoji(emoji);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add custom emojis to the map first so that they can't override system ones
|
this.updateEmojiMap();
|
||||||
this.emojis = new Map([...this.customEmojis, ...this.systemEmojis]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addCustomEmoji(emoji) {
|
addCustomEmoji(emoji) {
|
||||||
this.customEmojis.set(emoji.name, emoji);
|
this.customEmojis.set(emoji.name, emoji);
|
||||||
|
|
||||||
|
// this doesn't update this.emojis, but it's only called by setCustomEmojis which does that afterwards
|
||||||
}
|
}
|
||||||
|
|
||||||
removeCustomEmoji(id) {
|
removeCustomEmoji(id) {
|
||||||
@@ -69,6 +70,13 @@ class EmojiStore extends EventEmitter {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.updateEmojiMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
updateEmojiMap() {
|
||||||
|
// add custom emojis to the map first so that they can't override system ones
|
||||||
|
this.emojis = new Map([...this.customEmojis, ...this.systemEmojis]);
|
||||||
}
|
}
|
||||||
|
|
||||||
getSystemEmojis() {
|
getSystemEmojis() {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user