From 13e53e5b10cc8baa965a451b4c65db9219b14109 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Thu, 20 Jun 2019 13:05:19 +0200 Subject: [PATCH] modified api function for adding agent to policy to make it available on meta --- pandora_console/include/functions_api.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 3c6cdbf595..9d988cf58f 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -7523,8 +7523,15 @@ function api_set_remove_agent_from_policy($id, $id2, $thrash2, $thrash3) return; } + $agent_table = 'tagente'; + + if (is_metaconsole()) { + $agent_table = 'tmetaconsole_agent'; + } + $policy = policies_get_policy($id, false, false); - $agent = db_get_row_filter('tagente', ['id_agente' => $id2]); + $agent = db_get_row_filter($agent_table, ['id_agente' => $id2]); + $policy_agent = db_get_row_filter('tpolicy_agents', ['id_policy' => $id, 'id_agent' => $id2]); if (empty($policy)) {