From 027920182ebf2d4944ee4892eeec2cfe7f86fd79 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Sat, 3 Nov 2012 16:41:26 +0000 Subject: [PATCH] 2012-11-03 Miguel de Dios * godmode/users/configure_user.php: cleaned source code style. * include/styles/pandora.css, godmode/users/user_list.php: improved the row aspect of disabled users in the list. Pending task: #3540077 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7121 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 9 ++++++ .../godmode/users/configure_user.php | 5 ++- pandora_console/godmode/users/user_list.php | 31 ++++++++++--------- pandora_console/include/styles/pandora.css | 7 +++++ 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index db084a5191..149e597878 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2012-11-03 Miguel de Dios + + * godmode/users/configure_user.php: cleaned source code style. + + * include/styles/pandora.css, godmode/users/user_list.php: improved + the row aspect of disabled users in the list. + + Pending task: #3540077 + 2012-11-02 Miguel de Dios * include/functions_reporting.php, extensions/update_manager.php: diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index dc4e448067..a463a51e58 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -45,11 +45,14 @@ if (! check_acl ($config['id_user'], 0, "UM")) { return; } +/* + * Disabled at the moment. if (!check_referer()) { require ("general/noaccess.php"); return; } +*/ $tab = get_parameter('tab', 'user'); @@ -329,7 +332,7 @@ if ($delete_profile) { $perfilUser = db_get_row('tusuario_perfil', 'id_up', $id_up); $id_perfil = $perfilUser['id_perfil']; $perfil = db_get_row('tperfil', 'id_perfil', $id_perfil); - + db_pandora_audit("User management", "Deleted profile for user ".io_safe_input($id2), false, false, 'The profile with id ' . $id_perfil . ' in the group ' . $perfilUser['id_grupo']); diff --git a/pandora_console/godmode/users/user_list.php b/pandora_console/godmode/users/user_list.php index 68fc1330ce..9421d83d86 100644 --- a/pandora_console/godmode/users/user_list.php +++ b/pandora_console/godmode/users/user_list.php @@ -140,14 +140,14 @@ elseif (isset ($_GET["profile_del"])) { //delete profile elseif ($disable_user !== false) { //disable_user $id_user = get_parameter ("id", 0); - if($id_user !== 0) { + if ($id_user !== 0) { $result = users_disable ($id_user, $disable_user); } else { $result = false; } - if($disable_user == 1) { + if ($disable_user == 1) { ui_print_result_message ($result, __('Successfully disabled'), __('There was a problem disabling user')); @@ -192,14 +192,14 @@ $info1 = get_users ($order, array ('offset' => (int) get_parameter ('offset'), 'limit' => (int) $config['block_size'])); $info = array(); -$own_info = get_user_info ($config['id_user']); +$own_info = get_user_info ($config['id_user']); $own_groups = users_get_groups ($config['id_user'], 'AR', $own_info['is_admin']); if ($own_info['is_admin']) $info = $info1; // If user is not admin then don't display admin users and user of others groups. else - foreach ($info1 as $key => $usr){ + foreach ($info1 as $key => $usr) { $u = get_user_info ($key); $g = users_get_groups ($key, 'AR', $u['is_admin']); $result = array_intersect($g, $own_groups); @@ -220,26 +220,29 @@ foreach ($info as $user_id => $user_info) { else $table->rowclass[$iterator] = 'rowOdd'; $rowPair = !$rowPair; + if ($user_info['disabled']) { + $table->rowclass[$iterator] .= ' disabled_row_user'; + } $iterator++; $data[0] = ''.$user_id.''; - $data[1] = $user_info["fullname"].''; - $data[1] .= __('First name').': '.$user_info["firstname"].'
'; - $data[1] .= __('Last name').': '.$user_info["lastname"].'
'; - $data[1] .= __('Phone').': '.$user_info["phone"].'
'; - $data[1] .= __('E-mail').': '.$user_info["email"].'
'; + $data[1] = $user_info["fullname"] . '
'; + $data[1] .= __('First name') . ': ' . $user_info["firstname"].'
'; + $data[1] .= __('Last name') . ': ' . $user_info["lastname"].'
'; + $data[1] .= __('Phone') . ': ' . $user_info["phone"].'
'; + $data[1] .= __('E-mail') . ': ' . $user_info["email"].'
'; $data[1] .= '
'; $data[2] = ui_print_timestamp ($user_info["last_connect"], true); if ($user_info["is_admin"]) { $data[3] = html_print_image ("images/user_suit.png", true, array ("alt" => __('Admin'), - "title" => __('Administrator'))).' '; + "title" => __('Administrator'))) . ' '; } else { $data[3] = html_print_image ("images/user_green.png", true, array ("alt" => __('User'), - "title" => __('Standard User'))).' '; + "title" => __('Standard User'))) . ' '; } $data[3] .= ''; @@ -259,7 +262,7 @@ foreach ($info as $user_id => $user_info) { $data[4] = ui_print_string_substr ($user_info["comments"], 24, true); - if($user_info['disabled'] == 0) { + if ($user_info['disabled'] == 0) { $data[5] = ''.html_print_image('images/lightbulb.png', true, array('title' => __('Disable'))).''; } else { @@ -289,6 +292,4 @@ else { echo ''.__('The current authentication scheme doesn\'t support creating users from Pandora FMS').''; } echo ''; - - -?> +?> \ No newline at end of file diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 0fdcd1ef12..998e94e2e0 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -556,12 +556,19 @@ tr.rowOdd { tr.rowPair:hover { background-color: #E0E0E0; } + tr.rowOdd:hover { background-color: #E0E0E0 } + +tr.disabled_row_user * { + color: grey; +} + .bg { /* op menu */ background-color: #567953; } + .bg2 { /* main page */ background-color: #0A160C; }