1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-22 07:17:05 +00:00

prevent archiving of the user's own account because they'll lose access to the control panel

This commit is contained in:
Joshua Tauberer 2015-04-28 07:14:35 -04:00
parent 2f8866ef32
commit c03e00035f

View File

@ -188,6 +188,13 @@ function users_set_password(elem) {
function users_remove(elem) {
var email = $(elem).parents('tr').attr('data-email');
// can't remove yourself
if (api_credentials != null && email == api_credentials[0]) {
show_modal_error("Archive User", "You cannot archive your own account.");
return;
}
show_modal_confirm(
"Archive User",
$("<p>Are you sure you want to archive <b>" + email + "</b>?</p> <p>The user's mailboxes will not be deleted (you can do that later), but the user will no longer be able to log into any services on this machine.</p>"),