diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-07-06 15:09:27 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-09-26 11:55:34 +0200 |
commit | 1652a74febd10e56ec15fc90c93350fb48c796c4 (patch) | |
tree | fe7750854fce193bc70573057f7ffaf6d6f04989 /apps/dav/lib/CalDAV/Publishing/PublishPlugin.php | |
parent | 981c38f6d91be5a6de0ad319028afc3a4e931a2e (diff) | |
download | nextcloud-server-1652a74febd10e56ec15fc90c93350fb48c796c4.tar.gz nextcloud-server-1652a74febd10e56ec15fc90c93350fb48c796c4.zip |
Fix publish-url property & getPublishStatus() fct
Diffstat (limited to 'apps/dav/lib/CalDAV/Publishing/PublishPlugin.php')
-rw-r--r-- | apps/dav/lib/CalDAV/Publishing/PublishPlugin.php | 25 |
1 files changed, 12 insertions, 13 deletions
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); + }); } } |