diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0ab6d6947d..219c35f3f1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,34 @@ +2011-02-16 Juan Manuel Ramon + + * include/functions_alerts.php: New function get_alert_actions_filter. + * operation/agentes/estado_agente.php: If user is not admin or doesn't have + 'PM' privileges then don't display alerts of others groups. + * godmode/alerts/configure_alert_template.php: If user is not admin or doesn't have + 'PM' privileges then don't display templates of others groups. + * godmode/alerts/configure_alert_action.php: Don't show "create command" option + in this view if current user is not administrator or or doesn't have + 'PM' privileges. + * godmode/alerts/alert_list.builder.php: If user is not admin or doesn't have + 'PM' privileges then don't display alerts of others groups. + + Fixes: #3182557, 3182566 + + * include/functions_visual_map.php: Added a parameter in function get_user_layouts for + return All group or not. + * godmode/reporting/visual_console_builder.data.php: In map creation only display "All" + group if user has 'PM' privileges or is administrator. + * godmode/reporting/map_builder.php: If user is not admin or doesn't have + 'PM' privileges then don't display maps of others groups. + * operation/visual_console/index.php: If user is not admin or doesn't have + 'PM' privileges then don't display maps of others groups. + + Fixes: #3175721, 3175730 + + * godmode/users/configure_user.php: Only are shown "pandora management" and + "database management" profiles if current user is not administrator or or doesn't have + 'PM' privileges. + * godmode/alerts/alert_list.list.php: Fixed query for alert search. + 2011-02-16 Ramon Novoa * include/functions_menu.php: Fixed a typo. diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index baed8c1954..818732ffb0 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -64,7 +64,15 @@ $table->data[0][1] .= print_image('images/spinner.png', true) . ''; $table->data[1][0] = __('Template'); $table->data[1][0] = __('Template'); -$templates = get_alert_templates (false, array ('id', 'name')); +$own_info = get_user_info ($config['id_user']); +if ($own_info['is_admin']) + $templates = get_alert_templates (false, array ('id', 'name')); +else{ + $usr_groups = get_user_groups($config['id_user'], 'LW', false); + $filter_groups = ''; + $filter_groups = implode(',', array_keys($usr_groups)); + $templates = get_alert_templates (array ('id_group IN (' . $filter_groups . ')'), array ('id', 'name')); +} $table->data[1][1] = print_select (index_array ($templates, 'id', 'name'), 'template', '', '', __('Select'), 0, true); diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 23a5ae4d21..b6d5b05b39 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -131,7 +131,7 @@ if ($searchFlag) { FROM tagente AS t1 INNER JOIN tagente_modulo AS t2 ON t1.id_agente = t2.id_agente WHERE t1.nombre LIKE '" . trim($agentName) . "')"; if ($actionID != -1) - $where .= " AND id IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action = " . $actionID . ")"; + $where .= " AND talert_template_modules.id IN (SELECT id_alert_template_module FROM talert_template_module_actions WHERE id_alert_action = " . $actionID . ")"; if ($enabledisable != -1) $where .= " AND talert_template_modules.disabled =" . $enabledisable; if ($standby != -1) @@ -479,7 +479,11 @@ foreach ($simple_alerts as $alert) { $data[6] .= '