diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-05 20:55:39 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 20:55:39 -0500 |
commit | b084ceec3d8635b1e91d9db5e640a3016efc88b2 (patch) | |
tree | 523ad765f8991cc3fe8f50b0e43a029bb926cd37 /apps/dav | |
parent | 7d9688c89ed9178bdbedfb9fb38774a73c6e0ffe (diff) | |
parent | 63288ebc501739abb4da657eac49d4165f690dd3 (diff) | |
download | nextcloud-server-b084ceec3d8635b1e91d9db5e640a3016efc88b2.tar.gz nextcloud-server-b084ceec3d8635b1e91d9db5e640a3016efc88b2.zip |
Merge pull request #4224 from nextcloud/dont-list-on-public-calendar-endpoint
Don't list on public calendar endpoints
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/CalDAV/PublicCalendarRoot.php | 11 | ||||
-rw-r--r-- | apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php | 9 |
2 files changed, 4 insertions, 16 deletions
diff --git a/apps/dav/lib/CalDAV/PublicCalendarRoot.php b/apps/dav/lib/CalDAV/PublicCalendarRoot.php index 6d74b97f96e..94fb7e5e4d5 100644 --- a/apps/dav/lib/CalDAV/PublicCalendarRoot.php +++ b/apps/dav/lib/CalDAV/PublicCalendarRoot.php @@ -21,7 +21,6 @@ namespace OCA\DAV\CalDAV; use Sabre\DAV\Collection; -use Sabre\DAV\Exception\NotFound; class PublicCalendarRoot extends Collection { @@ -48,6 +47,7 @@ class PublicCalendarRoot extends Collection { */ function getChild($name) { $calendar = $this->caldavBackend->getPublicCalendar($name); + $calendar['{http://owncloud.org/ns}owner-principal'] = ''; return new Calendar($this->caldavBackend, $calendar, $this->l10n); } @@ -55,13 +55,6 @@ class PublicCalendarRoot extends Collection { * @inheritdoc */ function getChildren() { - $calendars = $this->caldavBackend->getPublicCalendars(); - $children = []; - foreach ($calendars as $calendar) { - // TODO: maybe implement a new class PublicCalendar ??? - $children[] = new Calendar($this->caldavBackend, $calendar, $this->l10n); - } - - return $children; + return []; } } diff --git a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php index 59fa4747a93..ccef0cf678b 100644 --- a/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php +++ b/apps/dav/tests/unit/CalDAV/PublicCalendarRootTest.php @@ -21,7 +21,7 @@ use Test\TestCase; */ class PublicCalendarRootTest extends TestCase { - const UNIT_TEST_USER = 'principals/users/caldav-unit-test'; + const UNIT_TEST_USER = ''; /** @var CalDavBackend */ private $backend; /** @var PublicCalendarRoot */ @@ -92,13 +92,8 @@ class PublicCalendarRootTest extends TestCase { public function testGetChildren() { $this->createPublicCalendar(); - - $publicCalendars = $this->backend->getPublicCalendars(); - $calendarResults = $this->publicCalendarRoot->getChildren(); - - $this->assertEquals(1, count($calendarResults)); - $this->assertEquals(new Calendar($this->backend, $publicCalendars[0], $this->l10n), $calendarResults[0]); + $this->assertSame([], $calendarResults); } /** |