mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 20:16:31 +02:00
dont check if guests/spiders are banned or load reason
This commit is contained in:
@@ -64,6 +64,9 @@ module.exports = function (User) {
|
||||
};
|
||||
|
||||
User.isBanned = function (uid, callback) {
|
||||
if (parseInt(uid, 10) <= 0) {
|
||||
return setImmediate(callback, null, false);
|
||||
}
|
||||
async.waterfall([
|
||||
async.apply(User.getUserFields, uid, ['banned', 'banned:expire']),
|
||||
function (userData, next) {
|
||||
@@ -90,6 +93,9 @@ module.exports = function (User) {
|
||||
};
|
||||
|
||||
User.getBannedReason = function (uid, callback) {
|
||||
if (parseInt(uid, 10) <= 0) {
|
||||
return setImmediate(callback, null, '');
|
||||
}
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
db.getSortedSetRevRange('uid:' + uid + ':bans:timestamp', 0, 0, next);
|
||||
|
||||
Reference in New Issue
Block a user