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);