From 54413d96b28a4608ad9a403991cf14513e359815 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Tue, 3 Jul 2012 10:11:20 +0000 Subject: [PATCH] 2012-07-03 Juan Manuel Ramon * include/functions_api.php: Removed innecesary flags in some policy function calls. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6729 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++++ pandora_console/include/functions_api.php | 28 +++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a587238fa6..92d94f8939 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-07-03 Juan Manuel Ramon + + * include/functions_api.php: Removed innecesary flags in some policy + function calls. + 2012-07-02 Juan Manuel Ramon * include/javascript/jquery.pandora.js: Changed size of modal diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 2c2e386c45..44e1a7e560 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -2624,7 +2624,7 @@ function api_set_validate_all_policy_alerts($id, $thrash1, $other, $thrash3) { // Check all policies foreach ($policies as $policy){ $policy_alerts = array(); - $policy_alerts = enterprise_hook('policies_get_alerts', array($policy['id'], false, false, true)); + $policy_alerts = enterprise_hook('policies_get_alerts', array($policy['id'], false, false)); @@ -2747,7 +2747,7 @@ function api_set_add_agent_policy($id, $thrash1, $other, $thrash3) { } // Check if the agent is already in the policy - $id_agent_policy = enterprise_hook('policies_get_agents', array($id, array('id_agent' => $other['data'][0]), 'id', true)); + $id_agent_policy = enterprise_hook('policies_get_agents', array($id, array('id_agent' => $other['data'][0]), 'id')); if ($id_agent_policy === ENTERPRISE_NOT_HOOK) { returnError('error_add_agent_policy', __('Error adding agent to policy.')); @@ -2798,7 +2798,7 @@ function api_set_add_data_module_policy($id, $thrash1, $other, $thrash3) { } // Check if the module is already in the policy - $name_module_policy = enterprise_hook('policies_get_modules', array($id, array('name'=>$other['data'][0]), 'name', true)); + $name_module_policy = enterprise_hook('policies_get_modules', array($id, array('name'=>$other['data'][0]), 'name')); if ($name_module_policy === ENTERPRISE_NOT_HOOK) { returnError('error_add_data_module_policy', __('Error adding data module to policy.')); @@ -2829,7 +2829,7 @@ function api_set_add_data_module_policy($id, $thrash1, $other, $thrash3) { } } - $success = enterprise_hook('policies_create_module', array($other['data'][0], $id, 1, $values, false, true)); + $success = enterprise_hook('policies_create_module', array($other['data'][0], $id, 1, $values, false)); if ($success) //returnData('string', array('type' => 'string', 'data' => __('Data module added to policy. Is necessary to apply the policy in order to changes take effect.'))); @@ -2868,7 +2868,7 @@ function api_set_update_data_module_policy($id, $thrash1, $other, $thrash3) { } // Check if the module exists - $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module', true)); + $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module')); if ($module_policy === false) { returnError('error_update_data_module_policy', __('Error updating data module in policy. Module doesn\'t exists.')); @@ -2938,7 +2938,7 @@ function api_set_add_network_module_policy($id, $thrash1, $other, $thrash3) { } // Check if the module is already in the policy - $name_module_policy = enterprise_hook('policies_get_modules', array($id, array('name'=>$other['data'][0]), 'name', true)); + $name_module_policy = enterprise_hook('policies_get_modules', array($id, array('name'=>$other['data'][0]), 'name')); if ($name_module_policy === ENTERPRISE_NOT_HOOK) { returnError('error_network_data_module_policy', __('Error adding network module to policy.')); @@ -2974,7 +2974,7 @@ function api_set_add_network_module_policy($id, $thrash1, $other, $thrash3) { } } - $success = enterprise_hook('policies_create_module', array($other['data'][0], $id, 2, $values, false, true)); + $success = enterprise_hook('policies_create_module', array($other['data'][0], $id, 2, $values, false)); if ($success) returnData('string', array('type' => 'string', 'data' => $success)); @@ -3012,7 +3012,7 @@ function api_set_update_network_module_policy($id, $thrash1, $other, $thrash3) { } // Check if the module exists - $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module', true)); + $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module')); if ($module_policy === false) { returnError('error_update_network_module_policy', __('Error updating network module in policy. Module doesn\'t exists.')); @@ -3080,7 +3080,7 @@ function api_set_add_plugin_module_policy($id, $thrash1, $other, $thrash3) { } // Check if the module is already in the policy - $name_module_policy = enterprise_hook('policies_get_modules', array($id, array('name'=>$other['data'][0]), 'name', true)); + $name_module_policy = enterprise_hook('policies_get_modules', array($id, array('name'=>$other['data'][0]), 'name')); if ($name_module_policy === ENTERPRISE_NOT_HOOK) { returnError('error_add_plugin_module_policy', __('Error adding plugin module to policy.')); @@ -3120,7 +3120,7 @@ function api_set_add_plugin_module_policy($id, $thrash1, $other, $thrash3) { } } - $success = enterprise_hook('policies_create_module', array($other['data'][0], $id, 4, $values, false, true)); + $success = enterprise_hook('policies_create_module', array($other['data'][0], $id, 4, $values, false)); if ($success) returnData('string', array('type' => 'string', 'data' => $success)); @@ -3159,7 +3159,7 @@ function api_set_update_plugin_module_policy($id, $thrash1, $other, $thrash3) { } // Check if the module exists - $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module', true)); + $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module')); if ($module_policy === false) { returnError('error_updating_plugin_module_policy', __('Error updating plugin module in policy. Module doesn\'t exists.')); @@ -3223,7 +3223,7 @@ function api_set_add_snmp_module_policy($id, $thrash1, $other, $thrash3) { } // Check if the module is already in the policy - $name_module_policy = enterprise_hook('policies_get_modules', array($id, array('name'=>$other['data'][0]), 'name', true)); + $name_module_policy = enterprise_hook('policies_get_modules', array($id, array('name'=>$other['data'][0]), 'name')); if ($name_module_policy === ENTERPRISE_NOT_HOOK) { returnError('error_add_snmp_module_policy', __('Error adding SNMP module to policy.')); @@ -3316,7 +3316,7 @@ function api_set_add_snmp_module_policy($id, $thrash1, $other, $thrash3) { } } - $success = enterprise_hook('policies_create_module', array($other['data'][0], $id, 2, $values, false, true)); + $success = enterprise_hook('policies_create_module', array($other['data'][0], $id, 2, $values, false)); if ($success) returnData('string', array('type' => 'string', 'data' => $success)); @@ -3356,7 +3356,7 @@ function api_set_update_snmp_module_policy($id, $thrash1, $other, $thrash3) { } // Check if the module exists - $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module', true)); + $module_policy = enterprise_hook('policies_get_modules', array($id, array('id' => $other['data'][0]), 'id_module')); if ($module_policy === false) { returnError('error_update_snmp_module_policy', __('Error updating SNMP module in policy. Module doesn\'t exists.'));