prevent administrators from being deleted - first remove them from admin group

v1.18.x
psychobunny 10 years ago
parent 45a0d0196b
commit 48c123592e

@ -98,6 +98,11 @@ User.deleteUsers = function(socket, uids, callback) {
}
async.each(uids, function(uid, next) {
user.isAdministrator(uid, function(err, isAdmin) {
if (err || isAdmin) {
return callback(err || new Error('[[error:cant-ban-other-admins]]'));
}
user.delete(uid, function(err) {
if (err) {
return next(err);
@ -108,6 +113,7 @@ User.deleteUsers = function(socket, uids, callback) {
websockets.logoutUser(uid);
next();
});
});
}, callback);
};

Loading…
Cancel
Save