diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 8aeb02110e..88c0b02c38 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2013-04-02 Junichi Satoh + + * lib/PandoraFMS/Core.pm: Added group ACL to 'Special days list'. + It is applied when group id is 0 (All) or the same as alert + template's group id. + 2013-04-01 Sancho Lerena * DEBIAN/postinst, diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 1459892c0b..97ad672f94 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -321,7 +321,7 @@ sub pandora_evaluate_alert ($$$$$$$;$$$) { my $date = sprintf("%4d%02d%02d", $year + 1900, $mon + 1, $mday); # '0001' means every year. my $date_every_year = sprintf("0001%02d%02d", $mon + 1, $mday); - my $special_day = get_db_value ($dbh, 'SELECT same_day FROM talert_special_days WHERE date = ? OR date = ? ORDER BY date DESC', $date, $date_every_year); + my $special_day = get_db_value ($dbh, 'SELECT same_day FROM talert_special_days WHERE (date = ? OR date = ?) AND (id_group = 0 OR id_group = ?) ORDER BY date DESC', $date, $date_every_year, $alert->{'id_group'}); if ($special_day ne '') { logger ($pa_config, $date . " is a special day for " . $alert->{'name'} . ". (as a " . $special_day . ")", 10); return 1 if ($alert->{$special_day} != 1);