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