mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-04 21:15:55 +01:00
closes #5132
This commit is contained in:
@@ -288,20 +288,14 @@ app.cacheBuster = null;
|
||||
|
||||
if (showWelcomeMessage) {
|
||||
showWelcomeMessage = false;
|
||||
if (document.readyState !== 'complete') {
|
||||
$(document).ready(showAlert.bind(null, 'login'));
|
||||
} else {
|
||||
showAlert('login');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (showBannedMessage) {
|
||||
showBannedMessage = false;
|
||||
if (document.readyState !== 'complete') {
|
||||
$(document).ready(showAlert.bind(null, 'banned'));
|
||||
} else {
|
||||
showAlert('banned');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -122,16 +122,7 @@ app.isConnected = false;
|
||||
}
|
||||
|
||||
function onEventBanned() {
|
||||
app.alert({
|
||||
title: '[[global:alert.banned]]',
|
||||
message: '[[global:alert.banned.message]]',
|
||||
type: 'danger',
|
||||
timeout: 1000
|
||||
});
|
||||
|
||||
setTimeout(function () {
|
||||
window.location.href = config.relative_path + '/';
|
||||
}, 1000);
|
||||
window.location.href = config.relative_path + '/';
|
||||
}
|
||||
|
||||
}());
|
||||
@@ -107,7 +107,7 @@ module.exports = function (middleware) {
|
||||
|
||||
if (results.banned) {
|
||||
req.logout();
|
||||
return res.redirect('/?banned=' + (results.banReason || ''));
|
||||
return res.redirect('/?banned=' + (results.banReason || 'no-reason'));
|
||||
}
|
||||
|
||||
results.user.isAdmin = results.isAdmin;
|
||||
|
||||
Reference in New Issue
Block a user