diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index cefe921c80..ad08ccb6fc 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2011-05-23 Sergio Martin + + * images/cog_db.png + images/cross_undo.png + godmode/agentes/module_manager_editor.php: Added two new images to + queue and added check when relink a module into policy avoiding it + when te policy is applying + 2011-05-23 Sergio Martin * godmode/agentes/module_manager_editor_common.php: Added hidden field diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 3f6d944ebe..e231f9064d 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -223,23 +223,35 @@ else { $snmp3_security_level = ""; } } -enterprise_include_once('include/functions_policies.php'); -$relink_policy = get_parameter('relink_policy', 0); -$unlink_policy = get_parameter('unlink_policy', 0); +$is_function_policies = enterprise_include_once('include/functions_policies.php'); -if($relink_policy) { - $result = policies_relink_module($id_agent_module); - ui_print_result_message($result, 'Module relinked to the policy successful'); - - db_pandora_audit("Agent management", "Re-link module " . $id_agent_module); -} +if($is_function_policies !== ENTERPRISE_NOT_HOOK) { + $relink_policy = get_parameter('relink_policy', 0); + $unlink_policy = get_parameter('unlink_policy', 0); + + if($relink_policy) { + $policy_info = policies_info_module_policy($id_agent_module); + $policy_id = $policy_info['id_policy']; + + if($relink_policy && policies_get_policy_queue_status ($policy_id) == STATUS_IN_QUEUE_APPLYING) { + ui_print_error_message(__('This policy is applying and cannot be modified')); + } + else { + $result = policies_relink_module($id_agent_module); + ui_print_result_message($result, __('Module relinked to the policy successful')); + + db_pandora_audit("Agent management", "Re-link module " . $id_agent_module); + } + } + + if($unlink_policy) { + $result = policies_unlink_module($id_agent_module); + ui_print_result_message($result, __('Module unlinked from the policy successful')); + + db_pandora_audit("Agent management", "Unlink module " . $id_agent_module); + } -if($unlink_policy) { - $result = policies_unlink_module($id_agent_module); - ui_print_result_message($result, 'Module unlinked from the policy successful'); - - db_pandora_audit("Agent management", "Unlink module " . $id_agent_module); } switch ($moduletype) { diff --git a/pandora_console/images/cog_db.png b/pandora_console/images/cog_db.png new file mode 100644 index 0000000000..442fbe7a36 Binary files /dev/null and b/pandora_console/images/cog_db.png differ diff --git a/pandora_console/images/cross_undo.png b/pandora_console/images/cross_undo.png new file mode 100644 index 0000000000..c4b1da2bab Binary files /dev/null and b/pandora_console/images/cross_undo.png differ