mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2013-07-29 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_api.php: a lot of tiny fixes. * extensions/api_checker.php: some fixes. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8591 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
3b72a6a4f4
commit
d343cc4c38
@ -1,3 +1,9 @@
|
||||
2013-07-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* include/functions_api.php: a lot of tiny fixes.
|
||||
|
||||
* extensions/api_checker.php: some fixes.
|
||||
|
||||
2013-07-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* extensions/api_checker.php: a tiny extension to make more easy
|
||||
|
@ -68,7 +68,7 @@ function extension_api_checker() {
|
||||
$id2 = io_safe_output(get_parameter('id2', ''));
|
||||
$return_type = io_safe_output(get_parameter('return_type', ''));
|
||||
$other = io_safe_output(get_parameter('other', ''));
|
||||
$other_mode = io_safe_output(get_parameter('other', 'url_encode_separator_|'));
|
||||
$other_mode = io_safe_output(get_parameter('other_mode', 'url_encode_separator_|'));
|
||||
|
||||
$api_execute = get_parameter('api_execute', 0);
|
||||
|
||||
@ -76,7 +76,8 @@ function extension_api_checker() {
|
||||
if ($api_execute) {
|
||||
$return_call_api =
|
||||
api_execute($url, $ip, $pandora_url, $apipass, $user, $password,
|
||||
$op, $op2, $id, $id2, $return_type, $other, $other_mode);
|
||||
$op, $op2, urlencode($id), urlencode($id2),
|
||||
$return_type, urlencode($other), $other_mode);
|
||||
}
|
||||
|
||||
ui_print_page_header (__("API checker"),
|
||||
@ -130,7 +131,7 @@ function extension_api_checker() {
|
||||
|
||||
$row = array();
|
||||
$row[] = __("ID 2");
|
||||
$row[] = html_print_input_text('id', $id2, '', 50, 255, true);
|
||||
$row[] = html_print_input_text('id2', $id2, '', 50, 255, true);
|
||||
$table2->data[] = $row;
|
||||
|
||||
$row = array();
|
||||
|
@ -81,8 +81,8 @@ function returnError($typeError, $returnType = 'string') {
|
||||
array('type' => 'string', 'data' => __('Id does not exist in BD.')));
|
||||
break;
|
||||
default:
|
||||
returnData($returnType,
|
||||
array('type' => 'string', 'data' => __($typeError)));
|
||||
returnData("string",
|
||||
array('type' => 'string', 'data' => __($returnType)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -100,8 +100,10 @@ function returnData($returnType, $data, $separator = ';') {
|
||||
case 'string':
|
||||
if ($data['type'] == 'string') {
|
||||
echo $data['data'];
|
||||
} else
|
||||
;//TODO
|
||||
}
|
||||
else {
|
||||
//TODO
|
||||
}
|
||||
break;
|
||||
case 'csv':
|
||||
case 'csv_head':
|
||||
@ -5546,7 +5548,7 @@ function api_set_enable_module_alerts ($agent_name, $module_name, $thrash3, $thr
|
||||
returnData('string', array('type' => 'string', 'data' => "Correct alerts enable"));
|
||||
}
|
||||
|
||||
function get_tags($thrash1, $thrash2, $other, $returnType, $user_in_db) {
|
||||
function api_get_tags($thrash1, $thrash2, $other, $returnType, $user_in_db) {
|
||||
if ($other['type'] == 'string') {
|
||||
if ($other['data'] != '') {
|
||||
returnError('error_parameter', 'Error in the parameters.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user