|
|
@ -29,7 +29,9 @@ SocketUser.deleteAccount = function(socket, data, callback) {
|
|
|
|
if (err || isAdmin) {
|
|
|
|
if (err || isAdmin) {
|
|
|
|
return callback(err || new Error('[[error:cant-delete-admin]]'));
|
|
|
|
return callback(err || new Error('[[error:cant-delete-admin]]'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
user.deleteAccount(socket.uid, callback);
|
|
|
|
user.deleteAccount(socket.uid, callback);
|
|
|
|
|
|
|
|
socket.broadcast.emit('event:user_status_change', {uid: socket.uid, status: 'offline'});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|