From 51f71d1a07107a1475fc9cdefdd23aa53f471603 Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 5 Sep 2018 11:23:53 +0200 Subject: [PATCH] fixed metaconsole tree view --- pandora_console/include/ajax/tree.ajax.php | 9 ++++++++- pandora_console/include/class/Tree.class.php | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/ajax/tree.ajax.php b/pandora_console/include/ajax/tree.ajax.php index b16d6d9669..c2e051c3f4 100644 --- a/pandora_console/include/ajax/tree.ajax.php +++ b/pandora_console/include/ajax/tree.ajax.php @@ -44,6 +44,7 @@ if (is_ajax ()) { require_once($config['homedir'] . "/include/class/TreeTag.class.php"); require_once($config['homedir'] . "/include/class/TreeGroup.class.php"); enterprise_include_once("include/class/TreePolicies.class.php"); + enterprise_include_once("include/class/TreeGroupMeta.class.php"); require_once($config['homedir'] . "/include/functions_reporting.php"); require_once($config['homedir'] . "/include/functions_os.php"); @@ -91,7 +92,13 @@ if (is_ajax ()) { $tree = new TreeTag($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access); break; case 'group': - $tree = new TreeGroup($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access); + if(is_metaconsole()){ + if (!class_exists('TreeGroupMeta')) break; + $tree = new TreeGroupMeta($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access); + } + else{ + $tree = new TreeGroup($type, $rootType, $id, $rootID, $serverID, $childrenMethod, $access); + } break; case 'policies': if (!class_exists('TreePolicies')) break; diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 28db9b837c..d6ca3d6ebc 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -70,6 +70,11 @@ class Tree { } public function setFilter($filter) { + // There is not module filter in metaconsole. + if (is_metaconsole()) { + $filter['searchModule'] = ""; + $filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS; + } $this->filter = $filter; } @@ -952,7 +957,6 @@ class Tree { $inner_or_left = $this->getInnerOrLeftJoin(); $group_inner = $this->getGroupSearchInner(); - $id_os = $this->rootID; $group_acl = $this->getGroupAclCondition(); $group_search_filter = $this->getGroupSearchFilter(); $agent_search_filter = $this->getAgentSearchFilter();