From 0a5890ddd30cfe42a9e5563bf3a220c27f9ff012 Mon Sep 17 00:00:00 2001 From: Daniel Barbero Martin Date: Wed, 25 Nov 2020 15:52:31 +0100 Subject: [PATCH] fix dialog tree view meta --- pandora_console/include/functions_treeview.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 6663623e8b..0bc19a2f31 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -529,16 +529,16 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) } } - // Get the agent info + // Get the agent info. $agent = db_get_row('tagente', 'id_agente', $id_agente); if ($agent == false) { return; } - // Check all groups + // Check all groups. $groups = agents_get_all_groups_agent($id_agente, $agent['id_grupo']); - if (is_metaconsole()) { + if (is_metaconsole() === true) { if (! check_acl_one_of_groups($config['id_user'], $groups, 'AR', false) && ! check_acl_one_of_groups($config['id_user'], $groups, 'AW', false) ) { @@ -548,7 +548,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) } } - if (is_metaconsole()) { + if (is_metaconsole() === true) { metaconsole_restore_db(); } @@ -565,6 +565,12 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) return; } + if (is_metaconsole()) { + if (metaconsole_connect($server_data) != NOERR) { + return; + } + } + if ($agent === false) { ui_print_error_message(__('There was a problem loading agent')); if (!empty($server_data) && is_metaconsole()) {