]> source.dussan.org Git - nextcloud-server.git/commitdiff
Force Calendar Obejct Chnage Path to support public write 29594/head
authorAnna Larch <anna@nextcloud.com>
Mon, 8 Nov 2021 13:29:34 +0000 (14:29 +0100)
committerAnna Larch <anna@nextcloud.com>
Mon, 8 Nov 2021 15:06:39 +0000 (16:06 +0100)
Signed-off-by: Anna Larch <anna@nextcloud.com>
apps/dav/lib/CalDAV/CalendarImpl.php
apps/dav/lib/CalDAV/Schedule/Plugin.php

index d45e12234d1db5d2e58270e55c0f829a3917047f..1c36db68cca852a353ccbfe91a8b620106ae637b 100644 (file)
@@ -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);
index 7ea75dcca2a8a03db561a7b20059e006941983fb..96bacce4454b6b6e8962bef8ef63125bf2253b43 100644 (file)
@@ -88,6 +88,16 @@ class Plugin extends \Sabre\CalDAV\Schedule\Plugin {
                $server->on('afterCreateFile', [$this, 'dispatchSchedulingResponses']);
        }
 
+       /**
+        * 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.
         *