From 9f99070a108a449ff731e580989260f073d694b5 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 19 Apr 2010 14:24:04 +0000 Subject: [PATCH] 2010-04-19 Sergio Martin * godmode/users/user_list.php: Fixed the delete the actual user feature hidding the red cross in this user and with internal control git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2580 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/godmode/users/user_list.php | 20 +++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 88c0b4e323..0a6f3579ab 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-04-19 Sergio Martin + + * godmode/users/user_list.php: Fixed the delete the actual + user feature hidding the red cross in this user and with + internal control + 2010-04-19 Sergio Martin * godmode/alerts/alert_list.list.php: Fixed a var definition diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index cfb0311b56..b92c334cf2 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -30,14 +30,20 @@ print_page_header (__('User management').' » '.__('Users defined in Pandor if (isset ($_GET["user_del"])) { //delete user $id_user = get_parameter_post ("delete_user"); - $result = delete_user ($id_user); + // Only allow delete user if is not the actual user + if($id_user != $config['id_user']){ + $result = delete_user ($id_user); - audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "User management", - "Deleted user ".safe_input($id_user)); + audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "User management", + "Deleted user ".safe_input($id_user)); - print_result_message ($result, - __('Successfully deleted'), - __('There was a problem deleting the user')); + print_result_message ($result, + __('Successfully deleted'), + __('There was a problem deleting the user')); + } + else + print_error_message (__('There was a problem deleting the user')); + } elseif (isset ($_GET["profile_del"])) { //delete profile $id_profile = (int) get_parameter_post ("delete_profile"); $result = delete_profile ($id_profile); @@ -115,7 +121,7 @@ foreach ($info as $user_id => $user_info) { $data[4] = print_string_substr ($user_info["comments"], 24, true); - if ($config["admin_can_delete_user"]) { + if ($config["admin_can_delete_user"] && $user_info['id_user'] != $config['id_user']) { $data[5] = print_input_image ("delete_user", "images/cross.png", $user_info["id_user"], 'border:0px;', true); //Delete user button } else { $data[5] = ''; //Delete button not in this mode