From 9a39d75f52992a8124c59256c0f91b8c72a32877 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 19 Aug 2010 17:23:08 +0000 Subject: [PATCH] 2010-08-19 Sergio Martin * godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager_editor_network.php godmode/agentes/module_manager_editor_wmi.php godmode/agentes/module_manager_editor_plugin.php godmode/agentes/module_manager_editor_prediction.php godmode/agentes/module_manager_editor.php: Added the policy linkation configuration in the modules form and allowed to modify modules config if the module is unlinked git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3163 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 11 ++++++++++ .../godmode/agentes/module_manager_editor.php | 20 +++++++++++++++++++ .../agentes/module_manager_editor_common.php | 2 +- .../agentes/module_manager_editor_network.php | 3 +-- .../agentes/module_manager_editor_plugin.php | 2 +- .../module_manager_editor_prediction.php | 2 +- .../agentes/module_manager_editor_wmi.php | 2 +- 7 files changed, 36 insertions(+), 6 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2782e55574..0085ffc310 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,14 @@ +2010-08-19 Sergio Martin + + * godmode/agentes/module_manager_editor_common.php + godmode/agentes/module_manager_editor_network.php + godmode/agentes/module_manager_editor_wmi.php + godmode/agentes/module_manager_editor_plugin.php + godmode/agentes/module_manager_editor_prediction.php + godmode/agentes/module_manager_editor.php: Added the policy linkation + configuration in the modules form and allowed to modify modules + config if the module is unlinked + 2010-08-19 Miguel de Dios * include/functions_html.php: fixed the function "print_checkbox_extended" diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index dc2bceae1e..a218b25ac4 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -209,6 +209,20 @@ if ($id_agent_module) { $snmp3_security_level = ""; } } +enterprise_include_once('include/functions_policies.php'); + +$relink_policy = get_parameter('relink_policy', 0); +$unlink_policy = get_parameter('unlink_policy', 0); + +if($relink_policy) { + $result = relink_module_policy($id_agent_module); + print_result_message($result, 'Module relinked to the policy successful'); +} + +if($unlink_policy) { + $result = unlink_module_policy($id_agent_module); + print_result_message($result, 'Module unlinked from the policy successful'); +} switch ($moduletype) { case "dataserver": @@ -268,6 +282,12 @@ if (isset ($extra_title)) echo ' - '.$extra_title; echo ''; +if (isModuleInPolicy($id_agent_module)) { + if($config['enterprise_installed']) { + add_policy_linkation($id_agent_module); + } +} + echo ''; echo '
'; diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index ddc0e826dd..0e53849228 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -99,7 +99,7 @@ $disabledTextBecauseInPolicy = ''; $page = get_parameter('page', ''); if (strstr($page, "policy_modules") === false) { if ($config['enterprise_installed']) - $disabledBecauseInPolicy = isModuleInPolicy($id_agent_module); + $disabledBecauseInPolicy = isModuleInPolicy($id_agent_module) && isModuleLinked($id_agent_module); else $disabledBecauseInPolicy = false; if ($disabledBecauseInPolicy) diff --git a/pandora_console/godmode/agentes/module_manager_editor_network.php b/pandora_console/godmode/agentes/module_manager_editor_network.php index 452009b5e9..26cb4d3f64 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_network.php +++ b/pandora_console/godmode/agentes/module_manager_editor_network.php @@ -20,7 +20,7 @@ $disabledTextBecauseInPolicy = ''; $page = get_parameter('page', ''); if (strstr($page, "policy_modules") === false) { if ($config['enterprise_installed']) - $disabledBecauseInPolicy = isModuleInPolicy($id_agent_module); + $disabledBecauseInPolicy = isModuleInPolicy($id_agent_module) && isModuleLinked($id_agent_module); else $disabledBecauseInPolicy = false; if ($disabledBecauseInPolicy) @@ -150,7 +150,6 @@ $data[3] = print_select(array('noAuthNoPriv' => __('Not auth and not privacy met if ($snmp_version != 3) $table_simple->rowstyle['field_snmpv3_row3'] = 'display: none;'; push_table_simple($data, 'field_snmpv3_row3'); - ?>