Allow to add events to group calendars via CalDAV

This commit is contained in:
Jörg Lehrke 2010-09-29 16:54:16 +00:00
parent bddb577d95
commit a85fdb55cd
2 changed files with 13 additions and 3 deletions

View File

@ -484,7 +484,7 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f
return $oldEvent;
}
if (is_null($oldEvent) && !$this->bo->check_perms(EGW_ACL_ADD, 0, $user))
if (is_null($oldEvent) && ($user >= 0) && !$this->bo->check_perms(EGW_ACL_ADD, 0, $user))
{
// we have no add permission on this user's calendar
if ($this->debug) error_log(__METHOD__."(,$user) we have not enough rights on this calendar");

View File

@ -1343,15 +1343,25 @@ class calendar_ical extends calendar_boupdate
if (!is_null($user))
{
if ($this->check_perms(EGW_ACL_ADD, 0, $user))
if (($user >= 0 ) && $this->check_perms(EGW_ACL_ADD, 0, $user))
{
$event['owner'] = $user;
}
else
elseif ($user >= 0)
{
date_default_timezone_set($GLOBALS['egw_info']['server']['server_timezone']);
return 0; // no permission
}
else
{
// Add Group a invitation
$event['owner'] = $this->user;
if (!isset($event['participants'][$this->user]))
{
$event['participants'][$this->user] = calendar_so::combine_status('A', 1, 'CHAIR');
}
$event['participants'][$user] = calendar_so::combine_status('U');
}
}
// check if an owner is set and the current user has add rights
// for that owners calendar; if not set the current user