diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ad86923c66..8e71289c08 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_tactical_view". Thanks Cucumber. + 2014-03-04 Miguel de Dios * include/functions_api.php: fixed the function "api_get_gis_agent". diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 4c0bafe8ab..ae241bd90e 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -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.'
'; - else - $result .= $key.': '.$data.'
'; - - $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 . '
'; + else + $result .= $key . ': ' . $data . '
'; + + $i++; + } + + $data = array('type' => 'string', 'data' => $result); + break; + case 'csv': + $data = array('type' => 'array', 'data' => array($tactical_info)); + break; + } returnData($returnType, $data); return;