From 7c56996a3abad3f0e4959e9e7e8cfa200ddbfc5e Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 2 Aug 2012 09:19:05 +0000 Subject: [PATCH] 2012-08-02 Sergio Martin * include/functions_api.php: Change the return of the functions recently added to numeric values to be easily checkable git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6840 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_api.php | 18 +++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5b9859219e..049bebb556 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2012-08-02 Sergio Martin + + * include/functions_api.php: Change the return of the + functions recently added to numeric values to be + easily checkable + 2012-07-31 Sergio Martin * pandora_console/include/functions_api.php: Added diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index e52f5e0bc5..dffaa68931 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -3206,7 +3206,7 @@ function api_set_update_plugin_module_policy($id, $thrash1, $other, $thrash3) { * * api.php?op=set&op2=add_module_in_conf&user=admin&pass=pandora&id=9043&id2=example_name&other=bW9kdWxlX2JlZ2luCm1vZHVsZV9uYW1lIGV4YW1wbGVfbmFtZQptb2R1bGVfdHlwZSBnZW5lcmljX2RhdGEKbW9kdWxlX2V4ZWMgZWNobyAxOwptb2R1bGVfZW5k * - * @return string success or error message + * @return string 0 when success, -1 when error */ function api_set_add_module_in_conf($id_agent, $module_name, $configuration_data, $thrash3) { $new_configuration_data = base64_decode($configuration_data['data']); @@ -3223,10 +3223,10 @@ function api_set_add_module_in_conf($id_agent, $module_name, $configuration_data $result = enterprise_hook('config_agents_add_module_in_conf', array($id_agent, $new_configuration_data)); if($result && $result !== ENTERPRISE_NOT_HOOK) { - returnData('string', array('type' => 'string', 'data' => 'Successfully added module to conf.')); + returnData('string', array('type' => 'string', 'data' => '0')); } else { - returnError('error_adding_module_conf', 'Error adding module to conf file.'); + returnError('error_adding_module_conf', '-1'); } } @@ -3243,16 +3243,16 @@ function api_set_add_module_in_conf($id_agent, $module_name, $configuration_data * * api.php?op=get&op2=module_from_conf&user=admin&pass=pandora&id=9043&id2=example_name * - * @return string success or error message + * @return string 0 when success, -1 when error */ function api_get_module_from_conf($id_agent, $module_name, $thrash2, $thrash3) { $result = enterprise_hook('config_agents_get_module_from_conf', array($id_agent, io_safe_output($module_name))); if($result !== ENTERPRISE_NOT_HOOK) { - returnData('string', array('type' => 'string', 'data' => $result)); + returnData('string', array('type' => 'string', 'data' => '0')); } else { - returnError('error_adding_module_conf', 'Error getting module from conf file.'); + returnError('error_adding_module_conf', '-1'); } } @@ -3268,7 +3268,7 @@ function api_get_module_from_conf($id_agent, $module_name, $thrash2, $thrash3) { * * api.php?op=set&op2=delete_module_in_conf&user=admin&pass=pandora&id=9043&id2=example_name * - * @return string success or error message + * @return string 0 when success, -1 when error */ function api_set_delete_module_in_conf($id_agent, $module_name, $thrash2, $thrash3) { $result = config_agents_delete_module_in_conf($id_agent, $module_name); @@ -3276,10 +3276,10 @@ function api_set_delete_module_in_conf($id_agent, $module_name, $thrash2, $thras $result = enterprise_hook('config_agents_delete_module_in_conf', array($id_agent, $module_name)); if($result && $result !== ENTERPRISE_NOT_HOOK) { - returnData('string', array('type' => 'string', 'data' => 'Successfully deleted module from conf.')); + returnData('string', array('type' => 'string', 'data' => '0')); } else { - returnError('error_deleting_module_conf', 'Error deleting module from conf file.'); + returnError('error_deleting_module_conf', '-1'); } }