From ba5ce80035b4563df2043d2dcce73b5d9b67f7f0 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Wed, 9 Jun 2010 10:04:02 +0000 Subject: [PATCH] 2010-06-09 Sergio Martin * util/pandora_manage.pl: Fixed errors of parameters for bug 3013419 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2885 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/util/pandora_manage.pl | 27 +++------------------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 42288abff2..598a304ba6 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2010-06-09 Sergio Martin + + * util/pandora_manage.pl: Fixed errors of parameters + for bug 3013419 + 2010-06-08 Ramon Novoa * DEBIAN/control, DEBIAN/make_deb_package.sh, diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 6a5aede247..ddd9b859db 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -43,7 +43,7 @@ my %conf; $| = 0; # Init -pandora_init(\%conf); +pandora_manage_init(\%conf); # Read config file pandora_load_config (\%conf); @@ -155,7 +155,7 @@ sub pandora_enable_group ($$$) { ############################################################################## # Init screen ############################################################################## -sub pandora_init ($) { +sub pandora_manage_init ($) { my $conf = shift; $conf->{"verbosity"}=0; # Verbose 1 by default @@ -236,18 +236,6 @@ sub pandora_delete_template_module ($$) { db_do ($dbh, 'DELETE FROM talert_template_module_actions WHERE id_alert_template_module = ?', $template_module_id); } -########################################################################## -## Asociate a module to a template. -########################################################################## -sub pandora_create_template_module_action ($$$) { - my ($dbh, $module_id, $template_id, $action_id) = @_; - - my $template_module_id = get_template_module_id ($dbh, $module_id, $template_id); - return -1 if ($template_module_id == -1); - - return db_insert ($dbh, 'INSERT INTO talert_template_module_actions (id_alert_template_module, id_alert_action) VALUES (?, ?, ?)', $template_module_id, $template_id, $action_id); -} - ########################################################################## ## Asociate a module to a template. ########################################################################## @@ -295,19 +283,10 @@ else { ########################################################################## sub pandora_create_template_module_action ($$$$$) { my ($dbh, $template_module_id, $action_id, $fires_min, $fires_max) = @_; - + return db_insert ($dbh, 'INSERT INTO talert_template_module_actions (id_alert_template_module, id_alert_action, fires_min, fires_max) VALUES (?, ?, ?, ?)', $template_module_id, $action_id, $fires_min, $fires_max); } -########################################################################## -## Asociate a module to a template. -########################################################################## -sub pandora_delete_template_module_action ($$$) { - my ($dbh, $template_module_id, $action_id) = @_; - - return db_do ($dbh, 'DELETE FROM talert_template_module_actions WHERE id_alert_template_module = ? AND id_alert_action = ?', $template_module_id, $action_id); -} - ########################################################################## ## Assign a profile to the given user/group. ##########################################################################