mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 18:36:35 +08:00
FEATURE: show a new modal when suspended users try to log in
This commit is contained in:
parent
afa4e58efd
commit
97130463d6
|
@ -69,6 +69,9 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
sentTo: result.sent_to_email,
|
||||
currentEmail: result.current_email
|
||||
});
|
||||
} else if (result.reason === 'suspended' ) {
|
||||
self.send("closeModal");
|
||||
bootbox.alert(result.error);
|
||||
} else {
|
||||
self.flash(result.error, 'error');
|
||||
}
|
||||
|
|
|
@ -261,8 +261,10 @@ class SessionController < ApplicationController
|
|||
def failed_to_login(user)
|
||||
message = user.suspend_reason ? "login.suspended_with_reason" : "login.suspended"
|
||||
|
||||
render json: { error: I18n.t(message, { date: I18n.l(user.suspended_till, format: :date_only),
|
||||
reason: user.suspend_reason}) }
|
||||
render json: {
|
||||
error: I18n.t(message, { date: I18n.l(user.suspended_till, format: :date_only), reason: user.suspend_reason}),
|
||||
reason: 'suspended'
|
||||
}
|
||||
end
|
||||
|
||||
def login(user)
|
||||
|
|
Loading…
Reference in New Issue
Block a user