mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-06 23:00:08 +01:00
showing temporary ban indicator in Users ACP, #4807
This commit is contained in:
@@ -55,6 +55,16 @@ module.exports = function(User) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (fields.indexOf('banned') !== -1) {
|
||||
// Also retrieve ban expiry for these users
|
||||
db.sortedSetScores('users:banned:expire', uids, function(err, scores) {
|
||||
users = users.map(function(userObj, idx) {
|
||||
userObj.banned_until = scores[idx] || 0;
|
||||
userObj.banned_until_readable = scores[idx] ? new Date(scores[idx]).toISOString() : 'Not Banned';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
modifyUserData(users, fieldsToRemove, callback);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user