2013-04-02 Junichi Satoh <junichi@rworks.jp>

* 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.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7909 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2013-04-02 06:38:43 +00:00
parent 98a4e05c94
commit 7d71091631
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2013-04-02 Junichi Satoh <junichi@rworks.jp>
* 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 <slerena@artica.es>
* DEBIAN/postinst,

View File

@ -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);