From 1049f5adb3866b6b42f6faebdc2dfad37cc90fe0 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 1 Sep 2011 09:05:32 +0000 Subject: [PATCH] 2011-09-01 Sergio Martin * lib/PandoraFMS/Core.pm: Improve the delete modules function to do the same actions of the console git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4866 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/Core.pm | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index a82e57483a..a8366fb7ad 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2011-09-01 Sergio Martin + + * lib/PandoraFMS/Core.pm: Improve the delete modules + function to do the same actions of the console + 2011-09-01 Sergio Martin * util/pandora_manage.pl diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index fd270a7fc7..d00997c4df 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1327,8 +1327,11 @@ sub pandora_delete_module ($$;$) { # Delete templates asociated to the module db_do ($dbh, 'DELETE FROM talert_template_modules WHERE id_agent_module = ?', $module_id); + # Delete events asociated to the module + db_do ($dbh, 'DELETE FROM tevento WHERE id_agentmodule = ?', $module_id); + # Set pending delete the module - db_do ($dbh, 'UPDATE tagente_modulo SET disabled = 1, delete_pending = 1 WHERE id_agente_modulo = ?', $module_id); + db_do ($dbh, 'UPDATE tagente_modulo SET disabled = 1, delete_pending = 1, nombre = "delete_pending" WHERE id_agente_modulo = ?', $module_id); my $agent_id = get_module_agent_id($dbh, $module_id);