Fixed "delete user from servers" in metaconsole. Ticket#3114

This commit is contained in:
Arturo Gonzalez 2015-12-24 13:35:54 +01:00
parent 39d25dce2c
commit 326b5cdd96
1 changed files with 19 additions and 18 deletions

View File

@ -153,26 +153,27 @@ if (isset ($_GET["user_del"])) { //delete user
foreach ($servers as $server) { foreach ($servers as $server) {
// Connect to the remote console // Connect to the remote console
metaconsole_connect($server); if (metaconsole_connect($server) == NOERR ) {
// Delete the user
// Delete the user $result = delete_user ($id_user);
$result = delete_user ($id_user); if ($result) {
if ($result) { db_pandora_audit("User management",
db_pandora_audit("User management", __("Deleted user %s from metaconsole", io_safe_input($id_user)));
__("Deleted user %s from metaconsole", io_safe_input($id_user))); }
// Restore the db connection
metaconsole_restore_db();
// Log to the metaconsole too
if ($result) {
db_pandora_audit("User management",
__("Deleted user %s from %s", io_safe_input($id_user), io_safe_input($server['server_name'])));
}
ui_print_result_message ($result,
__('Successfully deleted from %s', io_safe_input($server['server_name'])),
__('There was a problem deleting the user from %s', io_safe_input($server['server_name'])));
} }
else {
// Restore the db connection ui_print_error_message (__('There was a problem deleting the user from %s', io_safe_input($server['server_name'])));
metaconsole_restore_db();
// Log to the metaconsole too
if ($result) {
db_pandora_audit("User management",
__("Deleted user %s from %s", io_safe_input($id_user), io_safe_input($server['server_name'])));
} }
ui_print_result_message ($result,
__('Successfully deleted from %s', io_safe_input($server['server_name'])),
__('There was a problem deleting the user from %s', io_safe_input($server['server_name'])));
} }
} }
} }