diff --git a/pandora_console/godmode/events/event_edit_filter.php b/pandora_console/godmode/events/event_edit_filter.php index 46fb18ca81..ac95959135 100644 --- a/pandora_console/godmode/events/event_edit_filter.php +++ b/pandora_console/godmode/events/event_edit_filter.php @@ -29,11 +29,13 @@ $id = (int) get_parameter ('id'); $update = (string)get_parameter('update', 0); $create = (string)get_parameter('create', 0); -$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); +$strict_user = db_get_value('strict_acl', 'tusuario', 'id_user', + $config['id_user']); if ($id) { $permission = events_check_event_filter_group ($id); - if (!$permission) { // User doesn't have permissions to see this filter + if (!$permission) { + // User doesn't have permissions to see this filter require ("general/noaccess.php"); return; @@ -101,10 +103,10 @@ if($update || $create) { $tag_with_base64 = get_parameter('tag_with', json_encode(array())); $tag_with_json = io_safe_input(base64_decode($tag_with_base64)); - + $tag_without_base64 = get_parameter('tag_without', json_encode(array())); $tag_without_json = io_safe_input(base64_decode($tag_without_base64)); - + $filter_only_alert = get_parameter('filter_only_alert',''); $values = array ( @@ -130,7 +132,8 @@ if ($update) { ui_print_error_message (__('Not updated. Blank name')); } else { - $result = db_process_sql_update ('tevent_filter', $values, array ('id_filter' => $id)); + $result = db_process_sql_update ('tevent_filter', $values, + array ('id_filter' => $id)); ui_print_result_message ($result, __('Successfully updated'), @@ -138,7 +141,7 @@ if ($update) { } } -if ($create) { +if ($create) { $id = db_process_sql_insert('tevent_filter', $values); if ($id === false) { @@ -151,6 +154,7 @@ if ($create) { $own_info = get_user_info ($config['id_user']); +$table = new stdClass(); $table->width = '100%'; $table->border = 0; $table->cellspacing = 0; @@ -177,32 +181,42 @@ if (defined('METACONSOLE')) { } $table->data = array (); $table->data[0][0] = ''.__('Filter name').''; -$table->data[0][1] = html_print_input_text ('id_name', $id_name, false, 20, 80, true); +$table->data[0][1] = + html_print_input_text('id_name', $id_name, false, 20, 80, true); -$table->data[1][0] = ''.__('Save in group').'' . ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true); -$table->data[1][1] = html_print_select_groups($config['id_user'], "ER", users_can_manage_group_all(), "id_group_filter", $id_group_filter, '', '', -1, true, false, false, '', false, '', false, false, 'id_grupo', $strict_user); +$table->data[1][0] = '' . __('Save in group') . '' . + ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true); +$table->data[1][1] = html_print_select_groups( + $config['id_user'], "ER", users_can_manage_group_all(), + "id_group_filter", $id_group_filter, '', '', -1, true, false, false, + '', false, '', false, false, 'id_grupo', $strict_user); -$table->data[2][0] = ''.__('Group').''; -$table->data[2][1] = html_print_select_groups($config["id_user"], "ER", true, - 'id_group', $id_group, '', '', -1, true, false, false, '', false, false, false, false, 'id_grupo', $strict_user); +$table->data[2][0] = '' . __('Group').''; +$table->data[2][1] = html_print_select_groups($config["id_user"], "ER", + true, 'id_group', $id_group, '', '', -1, true, false, false, '', + false, false, false, false, 'id_grupo', $strict_user); $types = get_event_types (); // Expand standard array to add not_normal (not exist in the array, used only for searches) $types["not_normal"] = __("Not normal"); $table->data[3][0] = '' . __('Event type') . ''; -$table->data[3][1] = html_print_select ($types, 'event_type', $event_type, '', __('All'), '', true); +$table->data[3][1] = html_print_select( + $types, 'event_type', $event_type, '', __('All'), '', true); $table->data[4][0] = '' . __('Severity') . ''; -$table->data[4][1] = html_print_select (get_priorities (), "severity", $severity, '', __('All'), '-1', true); +$table->data[4][1] = html_print_select( + get_priorities(), "severity", $severity, '', __('All'), '-1', true); $fields = events_get_all_status(); $table->data[5][0] = '' . __('Event status') . ''; -$table->data[5][1] = html_print_select ($fields, 'status', $status, '', '', '', true); +$table->data[5][1] = html_print_select( + $fields, 'status', $status, '', '', '', true); $table->data[6][0] = '' . __('Free search') . ''; -$table->data[6][1] = html_print_input_text ('search', io_safe_output($search), '', 15, 255, true); +$table->data[6][1] = html_print_input_text( + 'search', io_safe_output($search), '', 15, 255, true); $table->data[7][0] = '' . __('Agent search') . ''; $params = array(); @@ -212,7 +226,7 @@ $params['input_name'] = 'text_agent'; $params['value'] = $text_agent; $params['selectbox_group'] = 'id_group'; -if(defined('METACONSOLE')) { +if (defined('METACONSOLE')) { $params['javascript_page'] = 'enterprise/meta/include/ajax/events.ajax'; } @@ -226,33 +240,41 @@ $lpagination[100] = 100; $lpagination[200] = 200; $lpagination[500] = 500; $table->data[8][0] = '' . __('Block size for pagination') . ''; -$table->data[8][1] = html_print_select ($lpagination, "pagination", $pagination, '', __('Default'), $config["block_size"], true); +$table->data[8][1] = html_print_select( + $lpagination, "pagination", $pagination, '', __('Default'), + $config["block_size"], true); $table->data[9][0] = '' . __('Max. hours old') . ''; -$table->data[9][1] = html_print_input_text ('event_view_hr', $event_view_hr, '', 5, 255, true); +$table->data[9][1] = html_print_input_text( + 'event_view_hr', $event_view_hr, '', 5, 255, true); -$table->data[10][0] = '' . __('User ack.') . ''. ' ' . ui_print_help_tip (__('Choose between the users who have validated an event. '), true); +$table->data[10][0] = '' . __('User ack.') . ''. ' ' . + ui_print_help_tip (__('Choose between the users who have validated an event. '), true); if ($strict_user) { - $users = array($config['id_user']=>$config['id_user']); -} else { - $users = users_get_user_users($config['id_user'], "ER", users_can_manage_group_all(0)); + $users = array($config['id_user'] => $config['id_user']); +} +else { + $users = users_get_user_users($config['id_user'], "ER", + users_can_manage_group_all(0)); } -$table->data[10][1] = html_print_select($users, "id_user_ack", $id_user_ack, '', __('Any'), 0, true); - +$table->data[10][1] = html_print_select($users, "id_user_ack", + $id_user_ack, '', __('Any'), 0, true); + $repeated_sel[0] = __("All events"); $repeated_sel[1] = __("Group events"); $table->data[11][0] = '' . __('Repeated') . ''; -$table->data[11][1] = html_print_select ($repeated_sel, "group_rep", $group_rep, '', '', '', true); +$table->data[11][1] = html_print_select ($repeated_sel, "group_rep", + $group_rep, '', '', '', true); $tag_with = json_decode($tag_with_json_clean, true); -if(empty($tag_with)) { +if (empty($tag_with)) { $tag_with = array(); } $tag_without = json_decode($tag_without_json_clean, true); -if(empty($tag_without)) { +if (empty($tag_without)) { $tag_without = array(); } @@ -289,8 +311,8 @@ $table->colspan[13][0] = '2'; $table->data[13][0] = '' . __('Events with following tags') . ''; $table->data[14][0] = html_print_select ($tags_select_with, 'select_with', '', '', '', 0, true, false, true, '', false, 'width: 220px;'); -$table->data[14][1] = html_print_button(__('Add'), 'add_whith', $add_with_tag_disabled, - '', 'class="add sub"', true); +$table->data[14][1] = html_print_button(__('Add'), 'add_whith', + $add_with_tag_disabled, '', 'class="add sub"', true); $table->data[15][0] = html_print_select ($tag_with_temp, 'tag_with_temp', array(), '', '', 0, true, true, @@ -304,20 +326,21 @@ $table->colspan[16][0] = '2'; $table->data[16][0] = '' . __('Events without following tags') . ''; $table->data[17][0] = html_print_select ($tags_select_without, 'select_without', '', '', '', 0, true, false, true, '', false, 'width: 220px;'); -$table->data[17][1] = html_print_button(__('Add'), 'add_whithout', $add_without_tag_disabled, - '', 'class="add sub"', true); +$table->data[17][1] = html_print_button(__('Add'), 'add_whithout', + $add_without_tag_disabled, '', 'class="add sub"', true); $table->data[18][0] = html_print_select ($tag_without_temp, 'tag_without_temp', array(), '', '', 0, true, true, true, '', false, "width: 220px; height: 50px;"); $table->data[18][0] .= html_print_input_hidden('tag_without', $tag_without_base64, true); -$table->data[18][1] = html_print_button(__('Remove'), 'remove_whithout', $remove_without_tag_disabled, - '', 'class="delete sub"', true); +$table->data[18][1] = html_print_button(__('Remove'), 'remove_whithout', + $remove_without_tag_disabled, '', 'class="delete sub"', true); $table->data[19][0] = '' . __('Alert events') . ''; $table->data[19][1] = html_print_select( - array('-1' => __('All'), + array( + '-1' => __('All'), '0' => __('Filter alert events'), '1' => __('Only alert events')), "filter_only_alert", $filter_only_alert, '', '', '', true); @@ -466,12 +489,14 @@ function click_button_add_tag(what_button) { } } - $(id_select_destiny).append($("")); + $(id_select_destiny) + .append($("")); $(id_select_origin + " option:selected").remove(); $(id_button_remove).removeAttr('disabled'); if ($(id_select_origin + " option").length == 0) { - $(id_select_origin).append($("")); + $(id_select_origin) + .append($("")); $(id_button_add).attr('disabled', 'true'); if (what_button == 'with') { diff --git a/pandora_console/include/constants.php b/pandora_console/include/constants.php index 92419f140c..c4339d9fb0 100755 --- a/pandora_console/include/constants.php +++ b/pandora_console/include/constants.php @@ -298,6 +298,7 @@ define ('EVENT_CRIT_MAJOR', 6); define ('EVENT_CRIT_CRITICAL', 4); define ('EVENT_CRIT_WARNING_OR_CRITICAL', 34); define ('EVENT_CRIT_NOT_NORMAL', 20); +define ('EVENT_CRIT_OR_NORMAL', 21); /* Id Module (more use in component)*/ define ('MODULE_DATA', 1); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index fc45d112fd..e92a6a7c5d 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1053,6 +1053,7 @@ function get_priorities ($priority_param = false) { $priorities[EVENT_CRIT_CRITICAL] = __('Critical'); $priorities[EVENT_CRIT_WARNING_OR_CRITICAL] = __('Warning').'/'.__('Critical'); $priorities[EVENT_CRIT_NOT_NORMAL] = __('Not normal'); + $priorities[EVENT_CRIT_OR_NORMAL] = __('Critical') . '/' . __('Normal'); foreach ($priorities as $key => $priority) { $priorities[$key] = ui_print_truncate_text($priority, GENERIC_SIZE_TEXT, false, true, false); diff --git a/pandora_console/mobile/operation/visualmap.php b/pandora_console/mobile/operation/visualmap.php index e7c2617fd7..22342777b7 100644 --- a/pandora_console/mobile/operation/visualmap.php +++ b/pandora_console/mobile/operation/visualmap.php @@ -104,7 +104,7 @@ class Visualmap { 'href' => 'index.php?page=visualmaps'))); $ui->showFooter(false); $ui->beginContent(); - + ob_start(); $rendered_map = '