2013-07-17 Sergio Martin <sergio.martin@artica.es>
* 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 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8538 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
6d5ee76abd
commit
f5fb7c94ae
|
@ -1,3 +1,14 @@
|
|||
2013-07-17 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* 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 <sergio.martin@artica.es>
|
||||
|
||||
* operation/events/events_list.php: Delete unnecessary ACL
|
||||
|
|
|
@ -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 "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&ev_group=0&group_rep=1&filter_only_alert=-1'>";
|
||||
echo "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&id_group=0&group_rep=1&filter_only_alert=-1'>";
|
||||
}
|
||||
else {
|
||||
$own_groups = array_keys(users_get_groups($config['id_user'], "IR", false));
|
||||
if (!empty($own_groups)){
|
||||
$events_group = array_shift($own_groups);
|
||||
echo "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&ev_group=0&group_rep=1&ev_group=$events_group&filter_only_alert=-1'>";
|
||||
echo "<a href='index.php?sec=eventos&sec2=operation/events/events&status=3&severity=4&event_view_hr=8&group_rep=1&id_group=$events_group&filter_only_alert=-1'>";
|
||||
}
|
||||
}
|
||||
html_print_image("images/lightning_go.png", false, array("title" => __("Critical events"), "style" => "margin-bottom: -5px;"));
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 .
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue