diff options
author | Anna Larch <anna@nextcloud.com> | 2021-11-08 16:29:34 +0300 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2021-11-08 18:06:39 +0300 |
commit | da227914240e9682fe97c83a20eada7d3ca92d47 (patch) | |
tree | 86fc0a3fc218d26f72c564d687094b45defdfdc1 | |
parent | 586cc9bcbc3a2c659d241cf82a538326aaeb3b1d (diff) |
Force Calendar Obejct Chnage Path to support public write
Signed-off-by: Anna Larch <anna@nextcloud.com>
-rw-r--r-- | apps/dav/lib/CalDAV/CalendarImpl.php | 5 | ||||
-rw-r--r-- | apps/dav/lib/CalDAV/Schedule/Plugin.php | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/apps/dav/lib/CalDAV/CalendarImpl.php b/apps/dav/lib/CalDAV/CalendarImpl.php index d45e12234d1..1c36db68cca 100644 --- a/apps/dav/lib/CalDAV/CalendarImpl.php +++ b/apps/dav/lib/CalDAV/CalendarImpl.php @@ -154,6 +154,11 @@ class CalendarImpl implements ICreateFromString { [, $user] = uriSplit($this->calendar->getPrincipalURI()); $fullCalendarFilename = sprintf('calendars/%s/%s/%s', $user, $this->calendarInfo['uri'], $name); + // Force calendar change URI + /** @var Schedule\Plugin $schedulingPlugin */ + $schedulingPlugin = $server->server->getPlugin('caldav-schedule'); + $schedulingPlugin->setPathOfCalendarObjectChange($fullCalendarFilename); + $stream = fopen('php://memory', 'rb+'); fwrite($stream, $calendarData); rewind($stream); diff --git a/apps/dav/lib/CalDAV/Schedule/Plugin.php b/apps/dav/lib/CalDAV/Schedule/Plugin.php index 7ea75dcca2a..96bacce4454 100644 --- a/apps/dav/lib/CalDAV/Schedule/Plugin.php +++ b/apps/dav/lib/CalDAV/Schedule/Plugin.php @@ -89,6 +89,16 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin { } /** + * Allow manual setting of the object change URL + * to support public write + * + * @param string $path + */ + public function setPathOfCalendarObjectChange(string $path): void { + $this->pathOfCalendarObjectChange = $path; + } + + /** * This method handler is invoked during fetching of properties. * * We use this event to add calendar-auto-schedule-specific properties. |