From cdd9af51080abfaec2be7b6c32a6e446a1203721 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 25 Jan 2024 15:25:08 +0100 Subject: [PATCH] #11799 hide interval for broker agents --- .../godmode/agentes/agent_manager.php | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pandora_console/godmode/agentes/agent_manager.php b/pandora_console/godmode/agentes/agent_manager.php index 28b8da32d3..80a480dd12 100644 --- a/pandora_console/godmode/agentes/agent_manager.php +++ b/pandora_console/godmode/agentes/agent_manager.php @@ -499,19 +499,23 @@ $tableAgent->data['primary_group'][0] .= ui_print_group_icon( 'after_input_icon' ); $tableAgent->data['primary_group'][0] .= ''; -// CHECK BROKER FOR SHOW INTERVAL. -enterprise_include('include/functions_config_agents.php'); -// Read configuration file. -$files = config_agents_get_agent_config_filenames($id_agente); -$file_name = $files['conf']; -$agent_config = file_get_contents($file_name); -$encoding = 'UTF-8'; -$agent_config_utf8 = mb_convert_encoding($agent_config, 'UTF-8', $encoding); -if ($agent_config_utf8 !== false) { - $agent_config = $agent_config_utf8; -} -$broker = str_contains($agent_config, '#broker active'); +$broker = false; +if (enterprise_installed()) { + // CHECK BROKER FOR SHOW INTERVAL. + enterprise_include('include/functions_config_agents.php'); + // Read configuration file. + $files = config_agents_get_agent_config_filenames($id_agente); + $file_name = $files['conf']; + $agent_config = file_get_contents($file_name); + $encoding = 'UTF-8'; + $agent_config_utf8 = mb_convert_encoding($agent_config, 'UTF-8', $encoding); + if ($agent_config_utf8 !== false) { + $agent_config = $agent_config_utf8; + } + + $broker = str_contains($agent_config, '#broker active'); +} if ($broker === false) { $tableAgent->data['caption_interval'][0] = __('Interval');