diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php
index cd31986a2a..8007c19077 100644
--- a/pandora_console/include/functions_netflow.php
+++ b/pandora_console/include/functions_netflow.php
@@ -600,7 +600,7 @@ function netflow_get_stats(
global $config, $nfdump_date_format;
// Requesting remote data.
- if (defined('METACONSOLE') && $connection_name != '') {
+ if (is_metaconsole() === true && empty($connection_name) === false) {
$data = metaconsole_call_remote_api($connection_name, 'netflow_get_stats', "$start_date|$end_date|".base64_encode(json_encode($filter))."|$aggregate|$max|$absolute|".(int) $address_resolution);
return json_decode($data, true);
}
@@ -612,7 +612,7 @@ function netflow_get_stats(
// Execute nfdump.
exec($command, $string);
- if (! is_array($string)) {
+ if (is_array($string) === false) {
return [];
}
@@ -1062,7 +1062,7 @@ function netflow_draw_item(
) {
$aggregate = $filter['aggregate'];
$interval = ($end_date - $start_date);
- if (defined('METACONSOLE')) {
+ if (is_metaconsole() === true) {
$width = 950;
} else {
$width = 850;
@@ -1084,12 +1084,13 @@ function netflow_draw_item(
$connection_name,
$address_resolution
);
- if (empty($data)) {
+
+ if (empty($data) === true) {
break;
}
- if ($output == 'HTML' || $output == 'PDF') {
- $html .= graph_netflow_aggregate_area(
+ if ($output === 'HTML' || $output === 'PDF') {
+ return graph_netflow_aggregate_area(
$data,
$interval,
$width,
@@ -1098,9 +1099,8 @@ function netflow_draw_item(
($output === 'HTML'),
$end_date
);
- return $html;
- } else if ($output == 'XML') {
- $xml .= '
'; } else { $advanced_toggle .= ' | '.__('Filter').' | '; - $advanced_toggle .= ''.__('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'class="mrgn_right_40px"', true).__('Custom').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'class="mrgn_right_40px"', true).' | '; + $advanced_toggle .= ''.__('Normal').' '.html_print_radio_button_extended('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true).__('Custom').' '.html_print_radio_button_extended('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true).' | '; } @@ -403,7 +403,7 @@ if (is_metaconsole()) { $advanced_toggle .= ''; $advanced_toggle .= ' | '; } else { - $advanced_toggle .= " | ".__('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip: 25.46.157.214,160.253.135.249'), true).' | ';
+ $advanced_toggle .= "".__('Dst Ip').ui_print_help_tip(__('Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip: 25.46.157.214,160.253.135.249'), true).' | ';
$advanced_toggle .= ''.html_print_input_text('ip_dst', $filter['ip_dst'], false, 40, 80, true).' | '; } @@ -411,7 +411,7 @@ if (is_metaconsole()) { $advanced_toggle .= ''; $advanced_toggle .= ' | '; } else { - $advanced_toggle .= " | ".__('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip: 25.46.157.214,160.253.135.249'), true).' | ';
+ $advanced_toggle .= "".__('Src Ip').ui_print_help_tip(__('Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip: 25.46.157.214,160.253.135.249'), true).' | ';
$advanced_toggle .= ''.html_print_input_text('ip_src', $filter['ip_src'], false, 40, 80, true).' | '; } @@ -422,7 +422,7 @@ if (is_metaconsole()) { $advanced_toggle .= ''; $advanced_toggle .= ' | '; } else { - $advanced_toggle .= " | ".__('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22: 80,22'), true).' | ';
+ $advanced_toggle .= "".__('Dst Port').ui_print_help_tip(__('Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22: 80,22'), true).' | ';
$advanced_toggle .= ''.html_print_input_text('dst_port', $filter['dst_port'], false, 40, 80, true).' | '; } @@ -430,19 +430,19 @@ if (is_metaconsole()) { $advanced_toggle .= ''; $advanced_toggle .= ' | '; } else { - $advanced_toggle .= " | ".__('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22: 80,22'), true).' | ';
+ $advanced_toggle .= "".__('Src Port').ui_print_help_tip(__('Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22: 80,22'), true).' | ';
$advanced_toggle .= ''.html_print_input_text('src_port', $filter['src_port'], false, 40, 80, true).' | '; } $advanced_toggle .= '||||||
";
+ echo "
|