From 0ddeab6b4c09acf6733f2a96576d162fdfeb5642 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Mon, 23 Jan 2012 07:52:43 +0000 Subject: [PATCH] 2012-01-20 Juan Manuel Ramon * include/functions_api.php: Modified get_all_agents function. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5398 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 4 ++++ pandora_console/include/functions_api.php | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 608d955dd8..069c3b455f 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2012-01-20 Juan Manuel Ramon + + * include/functions_api.php: Modified get_all_agents function. + 2012-01-20 Ramon Novoa * include/functions_netflow.php, diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index f5882df401..2e611e1639 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -785,7 +785,10 @@ function get_all_agents($thrash1, $thrash2, $other, $thrash3) { } // Filter by policy if ($other['data'][4] != ""){ - $where .= sprintf(" AND id_agente IN (select id_agent from tpolicy_agents where id_policy = %d)", $other['data'][4]); + $filter_by_policy = enterprise_hook('policies_get_filter_by_agent', array($other['data'][4])); + if ($filter_by_policy !== ENTERPRISE_NOT_HOOK){ + $where .= $filter_by_policy; + } } // Filter by state