2014-03-04 Miguel de Dios <miguel.dedios@artica.es>

* 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
This commit is contained in:
mdtrooper 2014-03-04 14:39:19 +00:00
parent 8710d7713c
commit bb7346eb47
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2014-03-04 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: fixed the function "api_get_policies".
Thanks Cucumber.
2014-03-04 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: fixed the function

View File

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