Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/dav/lib/CalDAV/PublicCalendarRoot.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
* @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
*
* @author Christoph Wurst <[email protected]>
* @author Georg Ehrke <[email protected]>
Expand Down Expand Up @@ -29,6 +30,7 @@
use OCP\IL10N;
use Psr\Log\LoggerInterface;
use Sabre\DAV\Collection;
use Sabre\DAV\Exception\Forbidden;

class PublicCalendarRoot extends Collection {

Expand Down Expand Up @@ -70,6 +72,10 @@ public function getName() {
* @inheritdoc
*/
public function getChild($name) {
// Sharing via link is allowed by default, but if the option is set it should be checked.
if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') === 'no' ) {
throw new \Sabre\DAV\Exception\Forbidden();
}
$calendar = $this->caldavBackend->getPublicCalendar($name);
return new PublicCalendar($this->caldavBackend, $calendar, $this->l10n, $this->config, $this->logger);
}
Expand Down
11 changes: 7 additions & 4 deletions apps/dav/lib/Server.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
* @copyright Copyright (c) 2022 Informatyka Boguslawski sp. z o.o. sp.k., http://www.ib.pl/
*
* @author Arthur Schiwon <[email protected]>
* @author Bjoern Schiessle <[email protected]>
Expand Down Expand Up @@ -181,10 +182,12 @@ public function __construct(IRequest $request, string $baseUri) {

$this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin());
$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig()));
$this->server->addPlugin(new \OCA\DAV\CalDAV\Publishing\PublishPlugin(
\OC::$server->getConfig(),
\OC::$server->getURLGenerator()
));
if (\OC::$server->getConfig()->getAppValue('core', 'shareapi_allow_links', 'yes') === 'yes') {

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getConfig has been marked as deprecated
$this->server->addPlugin(new \OCA\DAV\CalDAV\Publishing\PublishPlugin(
\OC::$server->getConfig(),

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getConfig has been marked as deprecated
\OC::$server->getURLGenerator()

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\Server::getURLGenerator has been marked as deprecated
));
}
}

// addressbook plugins
Expand Down