From 6d579568a9c288983f8dc3eed501d47845bf85ac Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 4 Mar 2014 14:39:19 +0000 Subject: [PATCH] 2014-03-04 Miguel de Dios * include/functions_api.php: fixed the function "api_get_policies". Thanks Cucumber. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9495 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/include/functions_api.php | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 8e71289c08..adf47dfe1d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2014-03-04 Miguel de Dios + + * include/functions_api.php: fixed the function "api_get_policies". + Thanks Cucumber. + 2014-03-04 Miguel de Dios * include/functions_api.php: fixed the function diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index ae241bd90e..fde3f37a93 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1167,14 +1167,14 @@ function api_get_policies($thrash1, $thrash2, $other, $thrash3) { $where = ''; if ($other['data'][0] != "") { - $where .= ' AND id_agent = ' . $other['data'][0]; + $where .= ' AND pol_agents.id_agent = ' . $other['data'][0]; $sql = sprintf("SELECT policy.id, name, id_agent - FROM tpolicies policy, tpolicy_agents pol_agents - WHERE policy.id = pol_agents.id %s", $where); + FROM tpolicies AS policy, tpolicy_agents AS pol_agents + WHERE policy.id = pol_agents.id_policy %s", $where); } else { - $sql = "SELECT id, name FROM tpolicies policy"; + $sql = "SELECT id, name FROM tpolicies AS policy"; } $policies = db_get_all_rows_sql($sql);