}
public function propPatch(PropPatch $propPatch) {
- // shared address books will be handled by
- // \OCA\DAV\DAV\CustomPropertiesBackend::propPatch
- // to save values in db table instead of dav object
- if (!$this->isShared()) {
+ if (!isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
parent::propPatch($propPatch);
}
}
'{' . Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'],
'{http://calendarserver.org/ns/}getctag' => $row['synctoken'],
'{http://sabredav.org/ns}sync-token' => $row['synctoken'] ?: '0',
+
];
// system address books are always read only
if ($principal === 'principals/system/system') {
+ $addressBook['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal'] = $row['principaluri'];
$addressBook['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only'] = true;
}
'{DAV:}displayname' => $group->getDisplayName(),
];
}
+ } elseif ($prefix === 'principals/system') {
+ return [
+ 'uri' => 'principals/system/' . $name,
+ '{DAV:}displayname' => $this->languageFactory->get('dav')->t("Accounts"),
+ ];
}
return null;
}
$backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock();
$backend->expects($this->atLeast(1))->method('updateAddressBook');
$addressBookInfo = [
- '{http://owncloud.org/ns}owner-principal' => 'user1',
'{DAV:}displayname' => 'Test address book',
'principaluri' => 'user1',
'id' => 666,