diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 35b994fead..0110e745ae 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -161,6 +161,10 @@ echo sprintf('
', $menuTypeClass); 'code' => false, ]; + if (isset($_GET['sec']) === false) { + $_GET['sec'] = ''; + } + if (!isset($_GET['sec2'])) { $_GET['sec2'] = ''; } diff --git a/pandora_console/general/noaccess.php b/pandora_console/general/noaccess.php index b2fe4515a2..9299489864 100644 --- a/pandora_console/general/noaccess.php +++ b/pandora_console/general/noaccess.php @@ -152,9 +152,11 @@ echo __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance.'); echo '

'; echo __('Please know that all attempts to access this page are recorded in security logs of %s System Database', get_product_name()); - if ($config['logged'] == false) { - if (session_status() === PHP_SESSION_ACTIVE) { - session_destroy(); + if (isset($config['logged']) === true) { + if ($config['logged'] == false) { + if (session_status() === PHP_SESSION_ACTIVE) { + session_destroy(); + } } } ?> diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 3505e7cf2c..db8d1132c3 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -521,10 +521,12 @@ if ($access_console_node === true) { if ((bool) check_acl($config['id_user'], 0, 'AW') === true) { $show_ipam = false; $ipam = db_get_all_rows_sql('SELECT users_operator FROM tipam_network'); - foreach ($ipam as $row) { - if (str_contains($row['users_operator'], '-1') || str_contains($row['users_operator'], $config['id_user'])) { - $show_ipam = true; - break; + if ($ipam !== false) { + foreach ($ipam as $row) { + if (str_contains($row['users_operator'], '-1') || str_contains($row['users_operator'], $config['id_user'])) { + $show_ipam = true; + break; + } } } } diff --git a/pandora_console/godmode/wizards/ManageExtensions.class.php b/pandora_console/godmode/wizards/ManageExtensions.class.php index 34c9950bc6..deb2a4dbf5 100644 --- a/pandora_console/godmode/wizards/ManageExtensions.class.php +++ b/pandora_console/godmode/wizards/ManageExtensions.class.php @@ -214,7 +214,8 @@ class ManageExtensions extends HTML break; default: - continue; + // Nothing. + break; } } diff --git a/pandora_console/include/class/ExtensionsDiscovery.class.php b/pandora_console/include/class/ExtensionsDiscovery.class.php index b9b5d0ebf2..f132cc160f 100644 --- a/pandora_console/include/class/ExtensionsDiscovery.class.php +++ b/pandora_console/include/class/ExtensionsDiscovery.class.php @@ -2190,7 +2190,8 @@ class ExtensionsDiscovery extends Wizard break; default: - continue; + // Nothing. + break; } if ($value !== false) { diff --git a/pandora_console/include/class/WelcomeWindow.class.php b/pandora_console/include/class/WelcomeWindow.class.php index 4a157540c5..ba9c89e350 100644 --- a/pandora_console/include/class/WelcomeWindow.class.php +++ b/pandora_console/include/class/WelcomeWindow.class.php @@ -376,10 +376,6 @@ class WelcomeWindow extends Wizard 'class' => 'modal', ]; - if (enterprise_installed() === true) { - $logo_url = ENTERPRISE_DIR.'/'.$logo_url; - } - if (check_acl($config['id_user'], 0, 'PM')) { $flag_um = false; $flag_cm = false; @@ -768,6 +764,10 @@ class WelcomeWindow extends Wizard ], true ); + if (isset($agents_num) === false) { + $agents_num = ''; + } + echo html_print_label_input_block( __('Number of agents to be created'), html_print_div( @@ -893,6 +893,10 @@ class WelcomeWindow extends Wizard __('Agent'), ui_print_agent_autocomplete_input($params) ); + if (isset($modules) === false) { + $modules = ''; + } + echo html_print_label_input_block( __('Module'), html_print_select( diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php index f713f68ee0..ce8a10527c 100644 --- a/pandora_console/include/functions_graph.php +++ b/pandora_console/include/functions_graph.php @@ -4701,11 +4701,13 @@ function graph_nodata_image($options) { global $config; - if ($options['base64'] === true) { - $dataImg = file_get_contents( - $config['homedir'].'/images/image_problem_area_150.png' - ); - return base64_encode($dataImg); + if (isset($options['base64']) === true) { + if ($options['base64'] === true) { + $dataImg = file_get_contents( + $config['homedir'].'/images/image_problem_area_150.png' + ); + return base64_encode($dataImg); + } } $style = ''; diff --git a/pandora_console/include/functions_register.php b/pandora_console/include/functions_register.php index db1bc8bf21..6b1d6ec0a7 100644 --- a/pandora_console/include/functions_register.php +++ b/pandora_console/include/functions_register.php @@ -144,7 +144,7 @@ function config_wiz_modal( 'UTC' => __('UTC'), ]; - if ($zone_selected == '') { + if (isset($zone_selected) === false) { if ($config['timezone'] != '') { $zone_array = explode('/', $config['timezone']); $zone_selected = $zone_array[0]; diff --git a/pandora_console/include/functions_reports.php b/pandora_console/include/functions_reports.php index bb9f57f5c3..c8e774acc7 100755 --- a/pandora_console/include/functions_reports.php +++ b/pandora_console/include/functions_reports.php @@ -1435,7 +1435,7 @@ function custom_fields_macros_report($macro, $key_macro) $macro['server_id'] ); if (metaconsole_connect($server) != NOERR) { - continue; + break; } } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 09803c43c6..bcf23c6d71 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4004,19 +4004,21 @@ function ui_print_datatable(array $parameters) $parameters['order']['order'] = $order; $parameters['order']['direction'] = $direction; - foreach ($parameters['no_sortable_columns'] as $key => $find) { - $found = array_search( - $parameters['no_sortable_columns'][$key], - $columns_tmp - ); + if (isset($parameters['no_sortable_columns']) === true) { + foreach ($parameters['no_sortable_columns'] as $key => $find) { + $found = array_search( + $parameters['no_sortable_columns'][$key], + $columns_tmp + ); - if ($found !== false) { - unset($parameters['no_sortable_columns'][$key]); - array_push($parameters['no_sortable_columns'], $found); - } + if ($found !== false) { + unset($parameters['no_sortable_columns'][$key]); + array_push($parameters['no_sortable_columns'], $found); + } - if (is_int($parameters['no_sortable_columns'][$key]) === false) { - unset($parameters['no_sortable_columns'][$key]); + if (is_int($parameters['no_sortable_columns'][$key]) === false) { + unset($parameters['no_sortable_columns'][$key]); + } } } @@ -4234,7 +4236,7 @@ function ui_print_datatable(array $parameters) } $parameters['phpDate'] = date('Y-m-d'); - $parameters['dataElements'] = json_encode($parameters['data_element']); + $parameters['dataElements'] = (isset($parameters['data_element']) === true) ? json_encode($parameters['data_element']) : ''; // * START JAVASCRIPT. $file_path = $config['homedir'].'/include/javascript/datatablesFunction.js'; diff --git a/pandora_console/include/graphs/fgraph.php b/pandora_console/include/graphs/fgraph.php index d8db7d64d9..5861f67033 100644 --- a/pandora_console/include/graphs/fgraph.php +++ b/pandora_console/include/graphs/fgraph.php @@ -1355,12 +1355,12 @@ function get_build_setup_charts($type, $options, $data) $chart->labels()->exchangeArray($options['labels']); foreach ($data as $key => $dataset) { $dataSet = $chart->createDataSet(); - $dataSet->setLabel($dataset['label']); + $dataSet->setLabel((isset($dataset['label']) === true) ? $dataset['label'] : ''); $dataSet->setBackgroundColor($dataset['backgroundColor']); $dataSet->setBorderColor($dataset['borderColor']); $dataSet->setPointBackgroundColor($dataset['pointBackgroundColor']); - $dataSet->setPointBorderColor($dataset['pointBorderColor']); - $dataSet->setPointHoverBackgroundColor($dataset['pointHoverBackgroundColor']); + $dataSet->setPointBorderColor((isset($dataset['pointBorderColor']) === true) ? $dataset['pointBorderColor'] : ''); + $dataSet->setPointHoverBackgroundColor((isset($dataset['pointHoverBackgroundColor']) === true) ? $dataset['pointHoverBackgroundColor'] : ''); $dataSet->setPointHoverBorderColor($dataset['pointHoverBorderColor']); $dataSet->data()->exchangeArray($dataset['data']); $chart->addDataSet($dataSet); diff --git a/pandora_console/include/lib/TacticalView/GeneralTacticalView.php b/pandora_console/include/lib/TacticalView/GeneralTacticalView.php index 06e27e4fd6..02f60f8252 100644 --- a/pandora_console/include/lib/TacticalView/GeneralTacticalView.php +++ b/pandora_console/include/lib/TacticalView/GeneralTacticalView.php @@ -144,9 +144,11 @@ class GeneralTacticalView { $js = ''; $output .= '
'; @@ -58,7 +62,7 @@ if ($files !== false) { } } -if ($files64 !== false) { +if (isset($files64) === true) { foreach ($files64 as $key => $file) { $output .= ''; }