diff --git a/pandora_console/ajax.php b/pandora_console/ajax.php index d7d51a453c..e5bef6b0c9 100644 --- a/pandora_console/ajax.php +++ b/pandora_console/ajax.php @@ -18,17 +18,14 @@ if ((! file_exists("include/config.php")) || (! is_readable("include/config.php" exit; } +// Real start +session_start(); + require_once ('include/config.php'); require_once ('include/functions.php'); require_once ('include/functions_db.php'); require_once ('include/auth/mysql.php'); -// Real start - -if (session_id() == '') { - session_start(); -} - // Hash login process if (isset ($_GET["loginhash"])) { diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index c07af3b298..d05132630b 100755 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -1555,10 +1555,14 @@ function graph_agent_status ($id_agent = false, $width = 300, $height = 200, $re $water_mark = array('file' => $config['homedir'] . "/images/logo_vertical_water.png", 'url' => ui_get_full_url("images/logo_vertical_water.png", false, false, false)); - $colors = array(COL_CRITICAL, COL_WARNING, COL_NORMAL, COL_UNKNOWN); + //$colors = array(COL_CRITICAL, COL_WARNING, COL_NORMAL, COL_UNKNOWN); + $colors[__('Critical')] = COL_CRITICAL; + $colors[__('Warning')] = COL_WARNING; + $colors[__('Normal')] = COL_NORMAL; + $colors[__('Unknown')] = COL_UNKNOWN; if ($show_not_init) { - $colors[] = COL_NOTINIT; + $colors[__('Not init')] = COL_NOTINIT; } if (array_sum($data) == 0) { diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index aded2a30cc..40dbd99f75 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1103,6 +1103,12 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi $aggregate = $filter['aggregate']; $unit = $filter['output']; $interval = $end_date - $start_date; + if (defined ('METACONSOLE')) { + $width = 950; + } else { + $width = 850; + } + $height = 320; // Process item switch ($type) { @@ -1119,7 +1125,8 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi if ($interval_length != 0) { $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); } - $html .= graph_netflow_aggregate_area ($data, $interval, 850, 320, netflow_format_unit ($unit)); + + $html .= graph_netflow_aggregate_area ($data, $interval, $width, $height, netflow_format_unit ($unit)); return $html; } else if ($output == 'PDF') { @@ -1128,7 +1135,7 @@ function netflow_draw_item ($start_date, $end_date, $interval_length, $type, $fi if ($interval_length != 0) { $html .= " " . _('Resolution') . ": $interval_length " . __('seconds'); } - $html .= graph_netflow_aggregate_area ($data, $interval, 850, 320, netflow_format_unit ($unit), 2, true); + $html .= graph_netflow_aggregate_area ($data, $interval, $width, $height, netflow_format_unit ($unit), 2, true); return $html; } else if ($output == 'XML') { diff --git a/pandora_console/operation/netflow/nf_live_view.php b/pandora_console/operation/netflow/nf_live_view.php index 894e226952..f37aa3762f 100644 --- a/pandora_console/operation/netflow/nf_live_view.php +++ b/pandora_console/operation/netflow/nf_live_view.php @@ -90,6 +90,7 @@ $time = get_parameter_post ('time', date (TIME_FORMAT, get_system_time ())); $connection_name = get_parameter('connection_name', ''); $interval_length = (int) get_parameter('interval_length', 300); $address_resolution = (int) get_parameter('address_resolution', $config['netflow_get_ip_hostname']); +$filter_selected = (int) get_parameter('filter_selected', 0); // Read buttons $draw = get_parameter('draw_button', ''); @@ -317,8 +318,9 @@ echo '
" . html_print_select_from_sql ($sql, 'filter_id', $filter_id, '', __('none'), 0, true) . ""; - + echo "" . html_print_select_from_sql ($sql, 'filter_id', $filter_id, '', __('Select a filter'), 0, true); + html_print_input_hidden("filter_selected", $filter_selected, false); + echo ""; echo ""; @@ -367,8 +369,13 @@ echo '"; echo ""; - echo "" . ui_print_help_icon ('pcap_filter', true, ui_get_full_url(false, false, false, false)) . ""; - echo "" . html_print_textarea ('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px; width: 90%;'", true) . ""; + if ($netflow_disable_custom_lvfilters) { + echo ""; + echo ""; + } else { + echo "" . ui_print_help_icon ('pcap_filter', true, ui_get_full_url(false, false, false, false)) . ""; + echo "" . html_print_textarea ('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px; width: 90%;'", true) . ""; + } echo ""; echo ""; @@ -411,9 +418,17 @@ echo'
'; if ($draw != '') { // Draw echo "
"; + + // No filter selected + if ($netflow_disable_custom_lvfilters && $filter_selected == 0) { + ui_print_error_message(__('No filter selected')); + } + // Draw the netflow chart + else { echo netflow_draw_item ($start_date, $end_date, $interval_length, $chart_type, $filter, $max_aggregates, $connection_name, 'HTML', $address_resolution); + } } enterprise_hook('close_meta_frame'); @@ -482,6 +497,7 @@ ui_include_time_picker(); // Check right filter type $("#radiobtn0001").attr("checked", "checked"); + $("#hidden-filter_selected").val(0); $("#text-ip_dst").val(''); $("#text-ip_src").val(''); $("#text-dst_port").val(''); @@ -496,6 +512,7 @@ ui_include_time_picker(); } else { // Load fields from DB + $("#hidden-filter_selected").val(1); // Get filter type 10; use constant ICMPSERVER => 11; use constant SNMPSERVER => 12; +# Value for a metaconsole license type +use constant METACONSOLE_LICENSE => 0x01; + # /dev/null our $DEVNULL = ($^O eq 'MSWin32') ? '/Nul' : '/dev/null';