diff options
author | Daniel <mail@danielkesselberg.de> | 2023-07-18 17:05:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 17:05:12 +0200 |
commit | aa5dcb095256d6352de758361798de86c3e2d0d0 (patch) | |
tree | 545f204f70def214ac07bb1124d07658576b7220 /apps/dav/lib/DAV/CustomPropertiesBackend.php | |
parent | 705ccd50c566fdd7f484b5084e377169e60f7b6a (diff) | |
parent | bb802956a2e3fd1f2d8d229cf4fad5b39f9226fb (diff) | |
download | nextcloud-server-aa5dcb095256d6352de758361798de86c3e2d0d0.tar.gz nextcloud-server-aa5dcb095256d6352de758361798de86c3e2d0d0.zip |
Merge pull request #38397 from nextcloud/enh/contacts/hide-adressbook-option
enh(contacts): show/hide addressbooks for all
Diffstat (limited to 'apps/dav/lib/DAV/CustomPropertiesBackend.php')
-rw-r--r-- | apps/dav/lib/DAV/CustomPropertiesBackend.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/dav/lib/DAV/CustomPropertiesBackend.php b/apps/dav/lib/DAV/CustomPropertiesBackend.php index bc822aee974..989d049fbd1 100644 --- a/apps/dav/lib/DAV/CustomPropertiesBackend.php +++ b/apps/dav/lib/DAV/CustomPropertiesBackend.php @@ -179,6 +179,21 @@ class CustomPropertiesBackend implements BackendInterface { } } + // substr of addressbooks/ => path is inside the CardDAV component + // three '/' => this a addressbook (no addressbook-home nor contact object) + if (str_starts_with($path, 'addressbooks/') && substr_count($path, '/') === 3) { + $allRequestedProps = $propFind->getRequestedProperties(); + $customPropertiesForShares = [ + '{DAV:}displayname', + ]; + + foreach ($customPropertiesForShares as $customPropertyForShares) { + if (in_array($customPropertyForShares, $allRequestedProps, true)) { + $requestedProps[] = $customPropertyForShares; + } + } + } + if (empty($requestedProps)) { return; } |