diff --git a/apps/dav/lib/caldav/birthdayservice.php b/apps/dav/lib/caldav/birthdayservice.php index 624c208694..5a0dfb6992 100644 --- a/apps/dav/lib/caldav/birthdayservice.php +++ b/apps/dav/lib/caldav/birthdayservice.php @@ -140,16 +140,10 @@ class BirthdayService { $date ); $vEvent->DTEND['VALUE'] = 'DATE'; -// $lm = new \DateTime('@' . $this->lastModified()); -// $lm->setTimeZone(new \DateTimeZone('UTC')); -// $vEvent->DTSTAMP->setDateTime($lm); $vEvent->{'UID'} = $doc->UID; $vEvent->{'RRULE'} = 'FREQ=YEARLY'; $vEvent->{'SUMMARY'} = $title . ' (' . $date->format('Y') . ')'; $vEvent->{'TRANSP'} = 'TRANSPARENT'; -// $appInfo = \OCP\App::getAppInfo('contacts'); -// $appVersion = \OCP\App::getAppVersion('contacts'); -// $vCal->PRODID = '-//ownCloud//NONSGML ' . $appInfo['name'] . ' ' . $appVersion . '//EN'; $vCal->add($vEvent); return $vCal; } diff --git a/apps/dav/lib/caldav/calendar.php b/apps/dav/lib/caldav/calendar.php index 8ed5b6563d..6b34d570eb 100644 --- a/apps/dav/lib/caldav/calendar.php +++ b/apps/dav/lib/caldav/calendar.php @@ -80,6 +80,10 @@ class Calendar extends \Sabre\CalDAV\Calendar implements IShareable { } function delete() { + if ($this->getName() === BirthdayService::BIRTHDAY_CALENDAR_URI) { + throw new Forbidden(); + } + if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal'])) { $principal = 'principal:' . parent::getOwner(); $shares = $this->getShares(); diff --git a/apps/dav/tests/unit/caldav/calendartest.php b/apps/dav/tests/unit/caldav/calendartest.php index 93b3f4bff8..4a3c94e8ab 100644 --- a/apps/dav/tests/unit/caldav/calendartest.php +++ b/apps/dav/tests/unit/caldav/calendartest.php @@ -37,7 +37,8 @@ class CalendarTest extends TestCase { $calendarInfo = [ '{http://owncloud.org/ns}owner-principal' => 'user1', 'principaluri' => 'user2', - 'id' => 666 + 'id' => 666, + 'uri' => 'cal', ]; $c = new Calendar($backend, $calendarInfo); $c->delete(); @@ -56,7 +57,8 @@ class CalendarTest extends TestCase { $calendarInfo = [ '{http://owncloud.org/ns}owner-principal' => 'user1', 'principaluri' => 'user2', - 'id' => 666 + 'id' => 666, + 'uri' => 'cal', ]; $c = new Calendar($backend, $calendarInfo); $c->delete();