fix dialog tree view meta

This commit is contained in:
Daniel Barbero Martin 2020-11-25 15:52:31 +01:00
parent 8471f170fb
commit 0a5890ddd3
1 changed files with 10 additions and 4 deletions

View File

@ -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()) {