diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-09-03 10:52:05 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-09-26 11:55:42 +0200 |
commit | d884370844c7f807b10aa09e63cb814927011572 (patch) | |
tree | ebafe7b1be706aad48b9aed2b631c5013ee3230c /apps/dav/lib/CalDAV/Publishing | |
parent | 4659e3ab599f18069765cb2414a8ace8bdf30ca8 (diff) | |
download | nextcloud-server-d884370844c7f807b10aa09e63cb814927011572.tar.gz nextcloud-server-d884370844c7f807b10aa09e63cb814927011572.zip |
Use true random string as uri for public calendars - as a result we can no longer return the pre-publish-url
Diffstat (limited to 'apps/dav/lib/CalDAV/Publishing')
-rw-r--r-- | apps/dav/lib/CalDAV/Publishing/PublishPlugin.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index 7434da6b62e..0e5377d30c1 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -94,22 +94,16 @@ class PublishPlugin extends ServerPlugin { public function propFind(PropFind $propFind, INode $node) { if ($node instanceof Calendar) { - $token = md5($this->config->getSystemValue('secret', '').$node->getResourceId()); - - $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token; - - $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node, $publishUrl) { + $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node) { if ($node->getPublishStatus()) { // We return the publish-url only if the calendar is published. + $token = $node->getName(); + $publishUrl = $this->urlGenerator->getAbsoluteURL($this->server->getBaseUri().'public-calendars/').$token; + return new Publisher($publishUrl, true); } }); - $propFind->handle('{'.self::NS_CALENDARSERVER.'}pre-publish-url', function () use ($node, $publishUrl) { - // The pre-publish-url is always returned - return new Publisher($publishUrl, false); - }); - $propFind->handle('{'.self::NS_CALENDARSERVER.'}allowed-sharing-modes', function() use ($node) { return new AllowedSharingModes(!$node->isSubscription(), !$node->isSubscription()); }); |