summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CardDAV
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-10-13 12:15:10 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-11-04 13:35:10 +0100
commitc778b1bade02ea772f23c75cb8de804d645feac4 (patch)
tree0cb07a9bc2fc9bd45e2cb9fd878884d6fa451f0d /apps/dav/lib/CardDAV
parent27304e5694fdec3eebf0700f2a82d9d80e928558 (diff)
downloadnextcloud-server-c778b1bade02ea772f23c75cb8de804d645feac4.tar.gz
nextcloud-server-c778b1bade02ea772f23c75cb8de804d645feac4.zip
Update sabre dav to 3.2 (#26115)
* Update sabre/dav to 3.2.0 * Adjust code to work with sabre/dav 3.2.0 and it's dependencies * Adding own CalDAV plugin to fix calendar home property * Test if there is a user logged in when listing files home * Update sabre version used by integration tests * Disable unauthenticated DAV access This is needed to make Sabre 3.2 behave like we did before. Eventually we should integrate better with the ACL plugin which itself should implement an auth failure when appropriate. ===== * Fixed so cherry-pick was succesfull Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/CardDAV')
-rw-r--r--apps/dav/lib/CardDAV/AddressBookImpl.php7
-rw-r--r--apps/dav/lib/CardDAV/CardDavBackend.php2
-rw-r--r--apps/dav/lib/CardDAV/Converter.php9
3 files changed, 9 insertions, 9 deletions
diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php
index 9de54eec33d..5f77c0f44f6 100644
--- a/apps/dav/lib/CardDAV/AddressBookImpl.php
+++ b/apps/dav/lib/CardDAV/AddressBookImpl.php
@@ -29,7 +29,6 @@ use OCP\IAddressBook;
use OCP\IURLGenerator;
use Sabre\VObject\Component\VCard;
use Sabre\VObject\Property;
-use Sabre\VObject\Property\Text;
use Sabre\VObject\Reader;
use Sabre\VObject\UUIDUtil;
@@ -209,7 +208,7 @@ class AddressBookImpl implements IAddressBook {
*/
protected function createEmptyVCard($uid) {
$vCard = new VCard();
- $vCard->add(new Text($vCard, 'UID', $uid));
+ $vCard->UID = $uid;
return $vCard;
}
@@ -225,8 +224,8 @@ class AddressBookImpl implements IAddressBook {
'URI' => $uri,
];
- foreach ($vCard->children as $property) {
- /** @var \Sabre\VObject\Property\Unknown $property */
+ foreach ($vCard->children() as $property) {
+ $result[$property->name] = $property->getValue();
if ($property->name === 'PHOTO' && $property->getValueType() === 'BINARY') {
$url = $this->urlGenerator->getAbsoluteURL(
$this->urlGenerator->linkTo('', 'remote.php') . '/dav/');
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php
index de717a17642..a320984c1fe 100644
--- a/apps/dav/lib/CardDAV/CardDavBackend.php
+++ b/apps/dav/lib/CardDAV/CardDavBackend.php
@@ -957,7 +957,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
]
);
- foreach ($vCard->children as $property) {
+ foreach ($vCard->children() as $property) {
if(!in_array($property->name, self::$indexProperties)) {
continue;
}
diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php
index 0f4a6fb3f08..d1fb754017e 100644
--- a/apps/dav/lib/CardDAV/Converter.php
+++ b/apps/dav/lib/CardDAV/Converter.php
@@ -43,16 +43,17 @@ class Converter {
$image = $this->getAvatarImage($user);
$vCard = new VCard();
- $vCard->add(new Text($vCard, 'UID', $uid));
+ $vCard->VERSION = '3.0';
+ $vCard->UID = $uid;
if (!empty($displayName)) {
- $vCard->add(new Text($vCard, 'FN', $displayName));
- $vCard->add(new Text($vCard, 'N', $this->splitFullName($displayName)));
+ $vCard->FN = $displayName;
+ $vCard->N = $this->splitFullName($displayName);
}
if (!empty($emailAddress)) {
$vCard->add(new Text($vCard, 'EMAIL', $emailAddress, ['TYPE' => 'OTHER']));
}
if (!empty($cloudId)) {
- $vCard->add(new Text($vCard, 'CLOUD', $cloudId));
+ $vCard->CLOUD = $cloudId;
}
if ($image) {
$vCard->add('PHOTO', $image->data(), ['ENCODING' => 'b', 'TYPE' => $image->mimeType()]);