mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
fixed a bug in ACP where you could accidentally delete or ban a user even if you clicked on cancel.
This commit is contained in:
@@ -91,7 +91,9 @@
|
|||||||
|
|
||||||
if(!isAdmin) {
|
if(!isAdmin) {
|
||||||
bootbox.confirm('Do you really want to delete "' + parent.attr('data-username') +'"?', function(confirm) {
|
bootbox.confirm('Do you really want to delete "' + parent.attr('data-username') +'"?', function(confirm) {
|
||||||
socket.emit('api:admin.user.deleteUser', uid);
|
if (confirm) {
|
||||||
|
socket.emit('api:admin.user.deleteUser', uid);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,9 +114,11 @@
|
|||||||
parent.attr('data-banned', 0);
|
parent.attr('data-banned', 0);
|
||||||
} else {
|
} else {
|
||||||
bootbox.confirm('Do you really want to ban "' + parent.attr('data-username') +'"?', function(confirm) {
|
bootbox.confirm('Do you really want to ban "' + parent.attr('data-username') +'"?', function(confirm) {
|
||||||
socket.emit('api:admin.user.banUser', uid);
|
if (confirm) {
|
||||||
banBtn.addClass('btn-warning');
|
socket.emit('api:admin.user.banUser', uid);
|
||||||
parent.attr('data-banned', 1);
|
banBtn.addClass('btn-warning');
|
||||||
|
parent.attr('data-banned', 1);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user