diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index b7e45f0fac..3af06054a4 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -319,6 +319,17 @@ if ($delete_user === true) { if ($id_user != $config['id_user']) { $user_row = users_get_user_by_id($id_user); + $private_dashboards = db_get_all_rows_filter( + 'tdashboard', + ['id_user' => $id_user], + 'id' + ); + + if (isset($private_dashboards) === true) { + db_process_sql_delete('tdashboard', ['id_user' => $id_user]); + header('Refresh:1'); + } + $result = delete_user($id_user); if ($result) { @@ -335,12 +346,16 @@ if ($delete_user === true) { ); // Delete the user in all the consoles. - if (is_metaconsole() === true && isset($_GET['delete_all'])) { + if (is_metaconsole() === true) { $servers = metaconsole_get_servers(); foreach ($servers as $server) { // Connect to the remote console. if (metaconsole_connect($server) === NOERR) { // Delete the user. + if (isset($private_dashboards) === true) { + db_process_sql_delete('tdashboard', ['id_user' => $id_user]); + } + $result = delete_user($id_user); if ($result) { db_pandora_audit( @@ -367,6 +382,8 @@ if ($delete_user === true) { __('There was a problem deleting the user from %s', io_safe_input($server['server_name'])) ); } + + header('Refresh:1'); } } else { ui_print_error_message(__('There was a problem deleting the user'));