mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
This commit is contained in:
@@ -22,7 +22,12 @@ SocketUser.exists = function(socket, data, callback) {
|
||||
|
||||
SocketUser.deleteAccount = function(socket, data, callback) {
|
||||
if (socket.uid) {
|
||||
user.deleteAccount(socket.uid, callback);
|
||||
user.isAdministrator(socket.uid, function(err, isAdmin) {
|
||||
if (err || isAdmin) {
|
||||
return callback(err || new Error('[[error:cant-delete-admin]]'));
|
||||
}
|
||||
user.deleteAccount(socket.uid, callback);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user