* CalDAV: could not set own status for participation in an exception, if not being a participant of master

This commit is contained in:
Ralf Becker 2015-10-12 11:55:20 +00:00
parent de4098e550
commit 8643b08e90
2 changed files with 5 additions and 5 deletions

View File

@ -2059,7 +2059,6 @@ class calendar_bo
if (!is_array($entry))
{
list($id,$recur_date) = explode(':',$entry);
if (!$this->check_perms(EGW_ACL_FREEBUSY, $id, 0, 'server')) return false;
$entry = $this->read($id, $recur_date, true, 'server');
}
$etag = $schedule_tag = $entry['id'].':'.$entry['etag'];

View File

@ -842,7 +842,9 @@ class calendar_groupdav extends groupdav_handler
{
$user_and_memberships = $GLOBALS['egw']->accounts->memberships($user, true);
$user_and_memberships[] = $user;
if (!array_intersect(array_keys($oldEvent['participants']), $user_and_memberships))
if (!array_intersect(array_keys($oldEvent['participants']), $user_and_memberships) &&
// above can be true, if current user is not in master but just a recurrence
(!$oldEvent['recur_type'] || !($series = self::get_series($oldEvent['uid'], $this->bo))))
{
if ($this->debug) error_log(__METHOD__."(,,$user) user $user is NOT an attendee!");
return '403 Forbidden';
@ -851,11 +853,10 @@ class calendar_groupdav extends groupdav_handler
if (($events = $handler->icaltoegw($vCalendar)))
{
$modified = 0;
$series = null;
foreach($events as $n => $event)
{
// for recurrances of event series, we need to read correct recurrence (or if series master is no first event)
if ($event['recurrence'] || $n && !$event['recurrence'])
if ($event['recurrence'] || $n && !$event['recurrence'] || isset($series))
{
// first try reading (virtual and real) exceptions
if (!isset($series))
@ -868,7 +869,7 @@ class calendar_groupdav extends groupdav_handler
if ($oldEvent['recurrence'] == $event['recurrence']) break;
}
// if no exception found, check if it might be just a recurrence (no exception)
if ($oldEvent['recurrence'] != $event['recurrence'])
if ($event['recurrence'] && $oldEvent['recurrence'] != $event['recurrence'])
{
if (!($oldEvent = $this->bo->read($eventId, $event['recurrence'], true)) ||
// virtual exceptions have recurrence=0 and recur_date=recurrence (series master or real exceptions have recurence=0)