From 001861b746171b48ade3ac491426b7d5a10ee819 Mon Sep 17 00:00:00 2001 From: fermin831 Date: Tue, 17 Jul 2018 08:51:39 +0200 Subject: [PATCH] Hide policy edition on centralized management on node --- .../godmode/agentes/module_manager.php | 6 ++++-- pandora_console/include/functions.php | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 91e7700d27..7b80693e42 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -70,7 +70,9 @@ if ($develop_bypass || is_metaconsole()) { $network_available = 1; $wmi_available = 1; $plugin_available = 1; - $prediction_available = 1; + // FIXME when prediction predictions server modules can be configured + // on metaconsole + $prediction_available = is_metaconsole() ? 0 : 1; } $modules = array (); @@ -107,7 +109,7 @@ $checked = get_parameter("checked"); if (($policy_page) || (isset($agent))) { if ($policy_page) { - $show_creation = true; + $show_creation = !is_central_policies_on_node(); } else { if (!isset($all_groups)) { diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 975d774c07..4b9e8ef6da 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1363,11 +1363,28 @@ function is_metaconsole() { return (bool) $config['metaconsole']; } +/** + * @brief Check if there is centralized management in metaconsole environment. + * Usefull to display some policy features on metaconsole. + * + * @return bool + */ function is_central_policies() { global $config; return is_metaconsole() && $config["centralized_management"]; } +/** + * @brief Check if there is centralized management in node environment. Usefull + * to reduce the policy functionallity on nodes. + * + * @return bool + */ +function is_central_policies_on_node() { + global $config; + return (!is_metaconsole()) && $config["centralized_management"]; +} + /** * Checks if current execution is under an AJAX request. *