]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(CardDAV): allow disabling of the system address book via config option 40200/head
authorAnna Larch <anna@nextcloud.com>
Thu, 17 Aug 2023 06:32:44 +0000 (08:32 +0200)
committerAnna <anna@nextcloud.com>
Tue, 5 Sep 2023 08:22:52 +0000 (10:22 +0200)
Signed-off-by: Anna Larch <anna@nextcloud.com>
apps/dav/lib/CardDAV/UserAddressBooks.php

index 938575bd1a775e5daba8c364307c1ac2f7747309..4d8812c73df6b131ebd0644ae0383da917dc37e2 100644 (file)
@@ -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;