diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 41d495fa51..40e37c4bac 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2013-07-17 Sergio Martin + + * operation/menu.php + operation/events/events_rss.php + operation/events/export_csv.php + operation/events/events_list.php + operation/events/events.php + operation/events/events.build_query.php + general/shortcut_bar.php: Fixed group filter + for bug #2346 and clean a lot of events code + 2013-07-17 Sergio Martin * operation/events/events_list.php: Delete unnecessary ACL diff --git a/pandora_console/general/shortcut_bar.php b/pandora_console/general/shortcut_bar.php index 480375ac84..53874f41b2 100644 --- a/pandora_console/general/shortcut_bar.php +++ b/pandora_console/general/shortcut_bar.php @@ -163,13 +163,13 @@ $own_info = get_user_info ($config['id_user']); // If user is admin can see all groups if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) { - echo ""; + echo ""; } else { $own_groups = array_keys(users_get_groups($config['id_user'], "IR", false)); if (!empty($own_groups)){ $events_group = array_shift($own_groups); - echo ""; + echo ""; } } html_print_image("images/lightning_go.png", false, array("title" => __("Critical events"), "style" => "margin-bottom: -5px;")); diff --git a/pandora_console/operation/events/events.build_query.php b/pandora_console/operation/events/events.build_query.php index cf848e844b..54e0347c05 100755 --- a/pandora_console/operation/events/events.build_query.php +++ b/pandora_console/operation/events/events.build_query.php @@ -16,16 +16,16 @@ $groups = users_get_groups($id_user, 'ER'); //Group selection -if ($ev_group > 0 && in_array ($ev_group, array_keys ($groups))) { +if ($id_group > 0 && in_array ($id_group, array_keys ($groups))) { if ($meta) { // In metaconsole the group search is performed by name - $group_name = groups_get_name ($ev_group); + $group_name = groups_get_name ($id_group); $sql_post = " AND group_name = '$group_name'"; } else { //If a group is selected and it's in the groups allowed - $sql_post = " AND id_grupo = $ev_group"; + $sql_post = " AND id_grupo = $id_group"; } } else { @@ -152,8 +152,8 @@ if (isset($filter_only_alert)) { } // Tags ACLS -if ($ev_group > 0 && in_array ($ev_group, array_keys ($groups))) { - $group_array = (array) $ev_group; +if ($id_group > 0 && in_array ($id_group, array_keys ($groups))) { + $group_array = (array) $id_group; } else { $group_array = array_keys($groups); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 682859bab4..1aaf162a31 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -180,7 +180,7 @@ if (is_ajax ()) { $offset = (int) get_parameter ("offset", 0); -$ev_group = (int) get_parameter ("ev_group", 0); //0 all +$id_group = (int) get_parameter('id_group', 0);//0 all $event_type = get_parameter ("event_type", ''); // 0 all $severity = (int) get_parameter ("severity", -1); // -1 all $status = (int) get_parameter ("status", 3); // -1 all, 0 only new, 1 only validated, 2 only in process, 3 only not validated, @@ -196,7 +196,6 @@ $text_agent = (string) get_parameter('text_agent', __("All")); $filter_only_alert = (int) get_parameter('filter_only_alert', -1); $filter_id = (int) get_parameter('filter_id', 0); $id_name = (string) get_parameter('id_name', ''); -$id_group = (int) get_parameter('id_group', 0); $open_filter = (int) get_parameter('open_filter', 0); $text_agent = (string) get_parameter("text_agent", __("All")); @@ -225,7 +224,7 @@ $params = "search=" . rawurlencode(io_safe_input($search)) . "&event_type=" . $event_type . "&severity=" . $severity . "&status=" . $status . - "&ev_group=" . $ev_group . + "&id_group=" . $id_group . "&refr=" . (int)get_parameter("refr", 0) . "&id_agent=" . $id_agent . "&pagination=" . $pagination . diff --git a/pandora_console/operation/events/events_list.php b/pandora_console/operation/events/events_list.php index b69f02af7f..9913b49798 100644 --- a/pandora_console/operation/events/events_list.php +++ b/pandora_console/operation/events/events_list.php @@ -590,7 +590,7 @@ $(document).ready( function() { // If selected 'none' flush filter if ( $("#filter_id").val() == 0 ) { $("#hidden-id_name").val(''); - $("#ev_group").val(0); + $("#id_group").val(0); $("#event_type").val(''); $("#severity").val(-1); $("#status").val(3); @@ -625,7 +625,7 @@ $(document).ready( function() { if (i == 'id_name') $("#hidden-id_name").val(val); if (i == 'id_group') - $("#ev_group").val(val); + $("#id_group").val(val); if (i == 'event_type') $("#event_type").val(val); if (i == 'severity') @@ -701,7 +701,7 @@ $(document).ready( function() { {"page" : "operation/events/events_list", "save_event_filter" : 1, "id_name" : $("#text-id_name").val(), - "id_group" : $("#ev_group").val(), + "id_group" : $("#id_group").val(), "event_type" : $("#event_type").val(), "severity" : $("#severity").val(), "status" : $("#status").val(), @@ -771,7 +771,7 @@ $(document).ready( function() { {"page" : "operation/events/events_list", "update_event_filter" : 1, "id" : $("#filter_id").val(), - "id_group" : $("#ev_group").val(), + "id_group" : $("#id_group").val(), "event_type" : $("#event_type").val(), "severity" : $("#severity").val(), "status" : $("#status").val(), diff --git a/pandora_console/operation/events/events_rss.php b/pandora_console/operation/events/events_rss.php index ed9e784f8a..e3fd4340f4 100644 --- a/pandora_console/operation/events/events_rss.php +++ b/pandora_console/operation/events/events_rss.php @@ -64,7 +64,7 @@ function rss_error_handler ($errno, $errstr, $errfile, $errline) { set_error_handler ('rss_error_handler', E_ALL); //Errors output as RSS -$ev_group = get_parameter ("ev_group", 0); // group +$id_group = get_parameter ("id_group", 0); // group $event_type = get_parameter ("event_type", ''); // 0 all $severity = (int) get_parameter ("severity", -1); // -1 all $status = (int) get_parameter ("status", 0); // -1 all, 0 only red, 1 only green diff --git a/pandora_console/operation/events/export_csv.php b/pandora_console/operation/events/export_csv.php index 5ebaf6fbac..fdb391f6a2 100644 --- a/pandora_console/operation/events/export_csv.php +++ b/pandora_console/operation/events/export_csv.php @@ -41,7 +41,7 @@ if (file_exists ($config['homedir'].'/include/languages/'.$user_language.'.mo')) } $offset = (int) get_parameter ("offset"); -$ev_group = (int) get_parameter ("ev_group"); // group +$id_group = (int) get_parameter ("id_group"); // group $event_type = (string) get_parameter ("event_type", "all"); // 0 all $severity = (int) get_parameter ("severity", -1); // -1 all $status = (int) get_parameter ("status", -1); // -1 all, 0 only red, 1 only green diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 872ebe007e..0fb5d935bc 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -234,12 +234,12 @@ if (check_acl ($config['id_user'], 0, "ER")) { $pss = get_user_info($config['id_user']); $hashup = md5($config['id_user'].$pss['password']); - $sub["operation/events/events_rss.php?user=".$config['id_user']."&hashup=".$hashup."&search=&event_type=&severity=-1&status=3&ev_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure="]["text"] = __('RSS'); - $sub["operation/events/events_rss.php?user=".$config['id_user']."&hashup=".$hashup."&search=&event_type=&severity=-1&status=3&ev_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure="]["type"] = "direct"; + $sub["operation/events/events_rss.php?user=".$config['id_user']."&hashup=".$hashup."&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure="]["text"] = __('RSS'); + $sub["operation/events/events_rss.php?user=".$config['id_user']."&hashup=".$hashup."&search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure="]["type"] = "direct"; //CSV - $sub["operation/events/export_csv.php?search=&event_type=&severity=-1&status=3&ev_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure="]["text"] = __('CSV File'); - $sub["operation/events/export_csv.php?search=&event_type=&severity=-1&status=3&ev_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure="]["type"] = "direct"; + $sub["operation/events/export_csv.php?search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure="]["text"] = __('CSV File'); + $sub["operation/events/export_csv.php?search=&event_type=&severity=-1&status=3&id_group=0&refr=0&id_agent=0&pagination=20&group_rep=1&event_view_hr=8&id_user_ack=0&tag_with=&tag_without=&filter_only_alert-1&offset=0&toogle_filter=no&filter_id=0&id_name=&id_group=0&history=0§ion=list&open_filter=0&pure="]["type"] = "direct"; //Marquee $sub["operation/events/events_marquee.php"]["text"] = __('Marquee');