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

* include/functions_api.php: fixed the function
	"api_get_tactical_view". Thanks Cucumber.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9492 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-03-04 10:53:09 +00:00
parent 57268d0a38
commit 8710d7713c
2 changed files with 24 additions and 11 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_tactical_view". Thanks Cucumber.
2014-03-04 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: fixed the function "api_get_gis_agent".

View File

@ -3602,7 +3602,7 @@ function api_set_update_plugin_module_policy($id, $thrash1, $other, $thrash3) {
foreach ($fields_plugin_module as $field) {
if ($other['data'][$cont] != "" and $field != 'id') {
$values[$field] = $other['data'][$cont];
if( $field === 'macros' ) {
$values[$field] = base64_decode($values[$field]);
}
@ -6403,17 +6403,25 @@ function api_set_create_event($id, $trash1, $other, $returnType) {
// http://localhost/pandora_console/include/api.php?op=get&op2=tactical_view&apipass=1234&user=admin&pass=pandora
function api_get_tactical_view($trash1, $trash2, $trash3, $returnType) {
$tactical_info = reporting_get_group_stats();
$i = 0;
foreach ($tactical_info as $key => $data) {
if ($i == 0)
$result = $key.': '.$data.'<br>';
else
$result .= $key.': '.$data.'<br>';
$i++;
}
$data = array('type' => 'string', 'data' => $result);
switch ($returnType) {
case 'string':
$i = 0;
foreach ($tactical_info as $key => $data) {
if ($i == 0)
$result = $key . ': ' . $data . '<br>';
else
$result .= $key . ': ' . $data . '<br>';
$i++;
}
$data = array('type' => 'string', 'data' => $result);
break;
case 'csv':
$data = array('type' => 'array', 'data' => array($tactical_info));
break;
}
returnData($returnType, $data);
return;