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,18 +153,15 @@ 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 // Restore the db connection
metaconsole_restore_db(); metaconsole_restore_db();
// Log to the metaconsole too // Log to the metaconsole too
if ($result) { if ($result) {
db_pandora_audit("User management", db_pandora_audit("User management",
@ -174,6 +171,10 @@ if (isset ($_GET["user_del"])) { //delete user
__('Successfully deleted from %s', io_safe_input($server['server_name'])), __('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']))); __('There was a problem deleting the user from %s', io_safe_input($server['server_name'])));
} }
else {
ui_print_error_message (__('There was a problem deleting the user from %s', io_safe_input($server['server_name'])));
}
}
} }
} }
else { else {