mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-18 03:31:03 +01:00
dont allow banned users to flag
This commit is contained in:
@@ -47,7 +47,7 @@ module.exports = function(SocketPosts) {
|
||||
privileges.categories.isAdminOrMod(post.topic.cid, socket.uid, next);
|
||||
},
|
||||
userData: function(next) {
|
||||
user.getUserFields(socket.uid, ['username', 'reputation'], next);
|
||||
user.getUserFields(socket.uid, ['username', 'reputation', 'banned'], next);
|
||||
}
|
||||
}, next);
|
||||
},
|
||||
@@ -56,6 +56,10 @@ module.exports = function(SocketPosts) {
|
||||
return next(new Error('[[error:not-enough-reputation-to-flag]]'));
|
||||
}
|
||||
|
||||
if (parseInt(user.banned, 10) === 1) {
|
||||
return next(new Error('[[error:user-banned]]'));
|
||||
}
|
||||
|
||||
flaggingUser = user.userData;
|
||||
flaggingUser.uid = socket.uid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user