From 26c08ebe0f7228ef6b0d11dc84953472ad0b4e13 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 14 Mar 2023 17:13:19 +0100 Subject: [PATCH 1/2] #10650 fixed bug when user access in view maintenance and show modules select --- .../models/VisualConsole/Items/DonutGraph.php | 5 ++--- .../operation/visual_console/public_view.php | 13 +++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php b/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php index 398a44b999..83a09866e0 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/DonutGraph.php @@ -226,7 +226,7 @@ final class DonutGraph extends Item 'module_input' => true, 'module_name' => 'moduleId', 'module_none' => false, - 'get_only_string_modules' => true, + 'get_only_string_modules' => false, ], ]; @@ -235,14 +235,13 @@ final class DonutGraph extends Item 'label' => __('Module'), 'arguments' => [ 'type' => 'autocomplete_module', - 'fields' => $fields, 'name' => 'moduleId', 'selected' => $values['moduleId'], 'return' => true, 'sort' => false, 'agent_id' => $values['agentId'], 'metaconsole_id' => $values['metaconsoleId'], - 'get_only_string_modules' => true, + 'get_only_string_modules' => false, ], ]; diff --git a/pandora_console/operation/visual_console/public_view.php b/pandora_console/operation/visual_console/public_view.php index 496a34f3a6..062c9419e2 100644 --- a/pandora_console/operation/visual_console/public_view.php +++ b/pandora_console/operation/visual_console/public_view.php @@ -62,7 +62,13 @@ 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'); +$userAccessMaintenance = null; +if (empty($config['id_user']) === true) { + $config['id_user'] = (string) get_parameter('id_user'); +} else { + $userAccessMaintenance = $config['id_user']; +} + $refr = (int) get_parameter('refr', ($config['refr'] ?? null)); if (!isset($config['pure'])) { @@ -179,6 +185,7 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(