--- horde5.1/kronolith/lib/Event.php.orig 2014-02-19 22:27:02.516569398 +0100
+++ horde5.1/kronolith/lib/Event.php 2014-02-19 22:37:23.644896111 +0100
@@ -891,14 +891,22 @@
$vEvent->addComponent($vAlarm);
}
$hordeAlarm = $GLOBALS['injector']->getInstance('Horde_Alarm');
- if ($hordeAlarm->exists($this->uid, $GLOBALS['registry']->getAuth()) &&
- $hordeAlarm->isSnoozed($this->uid, $GLOBALS['registry']->getAuth())) {
+ $alarm_now = new Horde_Date(time());
+ $alarm_now->setTimezone('UTC');
+ $alarm_end = new Horde_Date($this->end);
+ $alarm_end->setTimezone('UTC');
+ if ($alarm_end->before($alarm_now) ||
+ ($hordeAlarm->exists($this->uid, $GLOBALS['registry']->getAuth()) &&
+ $hordeAlarm->isSnoozed($this->uid, $GLOBALS['registry']->getAuth()))) {
$vEvent->setAttribute('X-MOZ-LASTACK', new Horde_Date($_SERVER['REQUEST_TIME']));
- $alarm = $hordeAlarm->get($this->uid, $GLOBALS['registry']->getAuth());
- if (!empty($alarm['snooze'])) {
- $alarm['snooze']->setTimezone(date_default_timezone_get());
- $vEvent->setAttribute('X-MOZ-SNOOZE-TIME', $alarm['snooze']);
- }
+
+ if ($hordeAlarm->exists($this->uid, $GLOBALS['registry']->getAuth())) {
+ $alarm = $hordeAlarm->get($this->uid, $GLOBALS['registry']->getAuth());
+ if (!empty($alarm['snooze'])) {
+ $alarm['snooze']->setTimezone(date_default_timezone_get());
+ $vEvent->setAttribute('X-MOZ-SNOOZE-TIME', $alarm['snooze']);
+ }
+ }
}
}