diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index e319694242..165fc8de36 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -1002,27 +1002,34 @@ class calendar_bo // Check if the $user is one of the participants or has a read-grant from one of them // in that case he has an implicite READ grant for that event // - foreach($event['participants'] as $uid => $accept) + if ($event['participants'] && is_array($event['participants'])) { - if ($uid == $user || $uid < 0 && in_array($user,$GLOBALS['egw']->accounts->members($uid,true))) + foreach($event['participants'] as $uid => $accept) { - // if we are a participant, we have an implicite READ and PRIVAT grant - $grants |= EGW_ACL_READ | EGW_ACL_PRIVATE; - break; - } - elseif ($this->grants[$uid] & EGW_ACL_READ) - { - // if we have a READ grant from a participant, we dont give an implicit privat grant too - $grants |= EGW_ACL_READ; - // we cant break here, as we might be a participant too, and would miss the privat grant - } - elseif (!is_numeric($uid)) - { - // if we have a resource as participant - $resource = $this->resource_info($uid); - $grants |= $resource['rights']; + if ($uid == $user || $uid < 0 && in_array($user,$GLOBALS['egw']->accounts->members($uid,true))) + { + // if we are a participant, we have an implicite READ and PRIVAT grant + $grants |= EGW_ACL_READ | EGW_ACL_PRIVATE; + break; + } + elseif ($this->grants[$uid] & EGW_ACL_READ) + { + // if we have a READ grant from a participant, we dont give an implicit privat grant too + $grants |= EGW_ACL_READ; + // we cant break here, as we might be a participant too, and would miss the privat grant + } + elseif (!is_numeric($uid)) + { + // if we have a resource as participant + $resource = $this->resource_info($uid); + $grants |= $resource['rights']; + } } } + else + { + error_log(__METHOD__." no participants for event:".print_r($event,true)); + } } if ($GLOBALS['egw']->accounts->get_type($owner) == 'g' && $needed == EGW_ACL_ADD)