aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorPawel Boguslawski <pawel.boguslawski@ib.pl>2022-10-02 16:38:01 +0200
committerPawel Boguslawski <pawel.boguslawski@ib.pl>2022-11-02 09:36:25 +0100
commitb1716b0ef0c79619c7134cefe5295feed5e1f27b (patch)
treea1708a7d6e729c5f86fb48d5c65617072d8b80af /apps/dav/lib
parent2600a00c007683f39e24028d4ad7a912937ef16f (diff)
downloadnextcloud-server-b1716b0ef0c79619c7134cefe5295feed5e1f27b.tar.gz
nextcloud-server-b1716b0ef0c79619c7134cefe5295feed5e1f27b.zip
Added parameter to disallow calendar subscription via link
Added calendar application config parameter `dav.allow_calendar_link_subscriptions` to disallow calendar subscription via link (i.e. for internal Nextcloud setups). Use ``` occ config:app:set dav allow_calendar_link_subscriptions --value 'yes' ``` to allow (default if not set) and ``` occ config:app:set dav allow_calendar_link_subscriptions --value 'no' ``` to disallow calendar subscription via link. Author-Change-Id: IB#1126265 Signed-off-by: Pawel Boguslawski <pawel.boguslawski@ib.pl>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Server.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/dav/lib/Server.php b/apps/dav/lib/Server.php
index f98dba22925..437a425fcd3 100644
--- a/apps/dav/lib/Server.php
+++ b/apps/dav/lib/Server.php
@@ -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 <blizzz@arthur-schiwon.de>
* @author Bjoern Schiessle <bjoern@schiessle.org>
@@ -177,7 +178,9 @@ class Server {
$this->server->addPlugin(\OC::$server->get(\OCA\DAV\CalDAV\Trashbin\Plugin::class));
$this->server->addPlugin(new \OCA\DAV\CalDAV\WebcalCaching\Plugin($request));
- $this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin());
+ if (\OC::$server->getConfig()->getAppValue('dav', 'allow_calendar_link_subscriptions', 'yes') === 'yes') {
+ $this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin());
+ }
$this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin());
$this->server->addPlugin(new DAV\Sharing\Plugin($authBackend, \OC::$server->getRequest(), \OC::$server->getConfig()));