From 66f8e31824f7be90cd3ebe6570a361e9d89091f1 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 13 Feb 2024 16:55:46 +0100 Subject: [PATCH] #12783 enabled correct modules when safe mode module is active in agent --- .../godmode/agentes/configurar_agente.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index a2372a66f0..7e9f566e17 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -2320,8 +2320,19 @@ if ($delete_module) { // Check if module is used by agent for Safe mode. $is_safe_mode_module = modules_check_safe_mode($id_borrar_modulo); - if ($is_safe_mode_module === true) { + if ($is_safe_mode_module === true && isset($id_agente) === true) { db_process_sql_update('tagente', ['safe_mode_module' => '0'], ['id_agente' => $id_agente]); + db_process_sql_update( + 'tagente_modulo', + [ + 'disabled' => 0, + 'disabled_by_safe_mode' => 0, + ], + [ + 'id_agente' => $id_agente, + 'disabled_by_safe_mode' => 1, + ] + ); } // Before delete the main module, check and delete the childrens from the original module.