From f22f6634d1d6e5407f5fddd7aae522cf64263b42 Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Wed, 7 Jun 2023 16:12:10 +0200 Subject: [PATCH] #11441 Add agentaccess to msg conditional --- .../include/class/ConsoleSupervisor.php | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 4dc665fb26..578861bd33 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -667,20 +667,24 @@ class ConsoleSupervisor */ public function checkAccessStatisticsPerformance() { + global $config; + $total_agents = db_get_value('count(*)', 'tagente'); if ($total_agents >= 200) { - db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']); - $this->notify( - [ - 'type' => 'NOTIF.ACCESSSTASTICS.PERFORMANCE', - 'title' => __('Access statistics performance'), - 'message' => __( - 'Usage of agent access statistics IS NOT RECOMMENDED on systems with more than 200 agents due performance penalty' - ), - 'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf', - ] - ); + if ($config['agentaccess'] !== 0) { + db_process_sql_update('tconfig', ['value' => 0], ['token' => 'agentaccess']); + $this->notify( + [ + 'type' => 'NOTIF.ACCESSSTASTICS.PERFORMANCE', + 'title' => __('Access statistics performance'), + 'message' => __( + 'Usage of agent access statistics IS NOT RECOMMENDED on systems with more than 200 agents due performance penalty' + ), + 'url' => '__url__/index.php?sec=general&sec2=godmode/setup/setup§ion=perf', + ] + ); + } } else { $this->cleanNotifications('NOTIF.ACCESSSTASTICS.PERFORMANCE'); }