From 3d6451d64b8416b5610b5b309989138cb27a3147 Mon Sep 17 00:00:00 2001 From: enriquecd Date: Tue, 9 Oct 2018 20:03:49 +0200 Subject: [PATCH] Fix returnData - #2881 --- pandora_console/include/functions_api.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 44814b6671..b71306456e 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -1755,13 +1755,21 @@ function api_get_all_agents($thrash1, $thrash2, $other, $returnType) { $result_agents = $all_agents; } + if (empty($returnType)) { + $returnType = "string"; + } + + if (empty($separator)) { + $separator = ";"; + } + foreach ($result_agents as $key => $value) { $result_agents[$key]['status'] = agents_get_status($result_agents[$key]['id_agente'], true); } if (count($result_agents) > 0 and $result_agents !== false) { $data = array('type' => 'array', 'data' => $result_agents); - return json_encode($data['data']); + returnData($returnType, $data, $separator); } else { returnError('error_all_agents', 'No agents retrieved.');