From c3639a22fb46f4262af415d14761cc1eedb3edb7 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 11 Jan 2022 14:36:05 +0100 Subject: [PATCH] vc php8 --- pandora_console/general/header.php | 3 +++ pandora_console/include/functions_agents.php | 2 +- .../include/rest-api/models/VisualConsole/Item.php | 8 ++++---- pandora_console/operation/visual_console/public_view.php | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 2b423360c6..3c82f32566 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -206,6 +206,8 @@ echo sprintf('
', $menuTypeClass); $select[0]['autorefresh_white_list'] ); + $header_autorefresh = ''; + $header_autorefresh_counter = ''; if ($config['legacy_vc'] || ($_GET['sec2'] !== 'operation/visual_console/render_view') || (($_GET['sec2'] !== 'operation/visual_console/render_view') @@ -900,6 +902,7 @@ echo sprintf('
', $menuTypeClass); if ($_GET['refr'] || (isset($do_refresh) === true && $do_refresh === true) ) { + $autorefresh_draw = false; if ($_GET['sec2'] == 'operation/events/events') { $autorefresh_draw = true; } diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 811f0f9287..1c8cc47a72 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1374,7 +1374,7 @@ function agents_get_group_agents( $key = $row['id_agente']; } - if ($row['id_server'] !== '') { + if (($row['id_server'] ?? '') !== '') { if (is_metaconsole()) { $server_name = db_get_row_filter( 'tmetaconsole_setup', diff --git a/pandora_console/include/rest-api/models/VisualConsole/Item.php b/pandora_console/include/rest-api/models/VisualConsole/Item.php index 420a8ce7ad..2baa14d838 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Item.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Item.php @@ -243,10 +243,10 @@ class Item extends CachedModel } $decodedData['agentDisabled'] = static::parseBool( - $data['agentDisabled'] + ($data['agentDisabled'] ?? false) ); $decodedData['moduleDisabled'] = static::parseBool( - $data['moduleDisabled'] + ($data['moduleDisabled'] ?? false) ); return $decodedData; @@ -1097,8 +1097,8 @@ class Item extends CachedModel $baseUrl = \ui_get_full_url('index.php'); $mobileUrl = \ui_get_full_url('mobile/index.php'); - if ((bool) $data['agentDisabled'] === true - || (bool) $data['moduleDisabled'] === true + if ((bool) ($data['agentDisabled'] ?? null) === true + || (bool) ($data['moduleDisabled'] ?? null) === true ) { return null; } diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 759888aabb..f873941552 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -63,7 +63,7 @@ require_once 'include/functions_visual_map.php'; $hash = (string) get_parameter('hash'); $visualConsoleId = (int) get_parameter('id_layout'); $config['id_user'] = (string) get_parameter('id_user'); -$refr = (int) get_parameter('refr', $config['refr']); +$refr = (int) get_parameter('refr', ($config['refr'] ?? null)); if (!isset($config['pure'])) { $config['pure'] = 0; @@ -180,7 +180,7 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(