Merge branch '2015-implementacion-de-grupos-secundarios-2' into 'develop'

Do not use cache only when secondary groups are used in tree view

See merge request artica/pandorafms!1420
This commit is contained in:
vgilc 2018-04-11 11:08:57 +02:00
commit 0333accb5b
1 changed files with 5 additions and 2 deletions

View File

@ -48,6 +48,7 @@ class Tree {
include_once($config['homedir']."/include/functions_servers.php");
include_once($config['homedir']."/include/functions_modules.php");
require_once($config['homedir']."/include/functions_tags.php");
enterprise_include_once("include/functions_agents.php");
if (is_metaconsole()) enterprise_include_once("meta/include/functions_ui_meta.php");
@ -2829,9 +2830,11 @@ class Tree {
protected function getGroupCounters($group_id) {
global $config;
static $group_stats = false;
// FIXME: Avoid to use cache when secondary groups is used
if (enterprise_hook('agents_is_using_secondary_groups')) {
return $this->getCounters($group_id);
}
# Do not use the group stat cache when using tags or real time group stats.
return $this->getCounters($group_id); // FIXME: Delete this line
// FIXME: AVOID TO REACH CACHE
if ($config['realtimestats'] == 1 ||
(isset($this->userGroups[$group_id]['tags']) && $this->userGroups[$group_id]['tags'] != "") ||
!empty($this->filter['searchAgent']) ) {