From 1652a74febd10e56ec15fc90c93350fb48c796c4 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 6 Jul 2016 15:09:27 +0200 Subject: Fix publish-url property & getPublishStatus() fct --- apps/dav/lib/CalDAV/Publishing/PublishPlugin.php | 25 ++++++++++++------------ 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'apps/dav/lib/CalDAV/Publishing/PublishPlugin.php') diff --git a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php index b1c42624201..f0be2f3a1b6 100644 --- a/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php +++ b/apps/dav/lib/CalDAV/Publishing/PublishPlugin.php @@ -72,19 +72,18 @@ class PublishPlugin extends ServerPlugin public function propFind(PropFind $propFind, INode $node) { if ($node instanceof Calendar) { - $token = md5(\OC::$server->getConfig()->getSystemValue('secret', '').$node->getName()); - - $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node, $token) { - if ($node->getPublishStatus()) { - return new Publisher($token, $node->getPublishStatus()); - } - }); - - $propFind->handle('{'.self::NS_CALENDARSERVER.'}pre-publish-url', function () use ($node, $token) { - if ($node->getPublishStatus()) { - return new Publisher($token, false); - } - }); + $token = md5(\OC::$server->getConfig()->getSystemValue('secret', '').$node->getName()); + $publishUrl = $this->server->getBaseUri() . 'public-calendars/' . $token; + + $propFind->handle('{'.self::NS_CALENDARSERVER.'}publish-url', function () use ($node, $publishUrl) { + if ($node->getPublishStatus()) { + return new Publisher($publishUrl, $node->getPublishStatus()); + } + }); + + $propFind->handle('{'.self::NS_CALENDARSERVER.'}pre-publish-url', function () use ($node, $publishUrl) { + return new Publisher($publishUrl, false); + }); } } -- cgit v1.2.3