mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
fixed #5166
This commit is contained in:
@@ -81,7 +81,6 @@ module.exports = function (middleware) {
|
|||||||
email: '',
|
email: '',
|
||||||
picture: meta.config.defaultAvatar,
|
picture: meta.config.defaultAvatar,
|
||||||
status: 'offline',
|
status: 'offline',
|
||||||
banned: false,
|
|
||||||
reputation: 0,
|
reputation: 0,
|
||||||
'email:confirmed': false
|
'email:confirmed': false
|
||||||
};
|
};
|
||||||
@@ -99,13 +98,13 @@ module.exports = function (middleware) {
|
|||||||
},
|
},
|
||||||
navigation: async.apply(navigation.get),
|
navigation: async.apply(navigation.get),
|
||||||
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags),
|
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags),
|
||||||
banReason: async.apply(user.getBannedReason, req.uid)
|
banned: async.apply(user.isBanned, req.uid)
|
||||||
}, function (err, results) {
|
}, function (err, results) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (results.user && parseInt(results.user.banned, 10) === 1) {
|
if (results.banned) {
|
||||||
req.logout();
|
req.logout();
|
||||||
return res.redirect('/?banned=' + (results.banReason || ''));
|
return res.redirect('/?banned=' + (results.banReason || ''));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user