summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Larch <anna@nextcloud.com>2023-08-17 08:32:44 +0200
committerAnna <anna@nextcloud.com>2023-09-05 10:22:52 +0200
commit6354dce7ea1b9fdcee344bd9a484988a06b02382 (patch)
tree792fa8d3149de623b3e7b69ac6357c1029ea4f4f
parent9ddb07ca1979e178b74184173edec9c6a7b7653e (diff)
downloadnextcloud-server-6354dce7ea1b9fdcee344bd9a484988a06b02382.tar.gz
nextcloud-server-6354dce7ea1b9fdcee344bd9a484988a06b02382.zip
fix(CardDAV): allow disabling of the system address book via config option
Signed-off-by: Anna Larch <anna@nextcloud.com>
-rw-r--r--apps/dav/lib/CardDAV/UserAddressBooks.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/dav/lib/CardDAV/UserAddressBooks.php b/apps/dav/lib/CardDAV/UserAddressBooks.php
index 938575bd1a7..4d8812c73df 100644
--- a/apps/dav/lib/CardDAV/UserAddressBooks.php
+++ b/apps/dav/lib/CardDAV/UserAddressBooks.php
@@ -88,7 +88,8 @@ class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
$addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri);
// add the system address book
$systemAddressBook = null;
- if (is_string($principal) && $principal !== 'principals/system/system' && $this->carddavBackend instanceof CardDavBackend) {
+ $systemAddressBookExposed = $this->config->getAppValue('dav', 'system_addressbook_exposed', 'yes') === 'yes';
+ if ($systemAddressBookExposed && is_string($principal) && $principal !== 'principals/system/system' && $this->carddavBackend instanceof CardDavBackend) {
$systemAddressBook = $this->carddavBackend->getAddressBooksByUri('principals/system/system', 'system');
if ($systemAddressBook !== null) {
$systemAddressBook['uri'] = SystemAddressbook::URI_SHARED;