summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-13 11:55:50 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-18 22:17:07 +0100
commitac55bac4610cc03445d50e845bdf205ed7288b78 (patch)
tree0f6b5c72f02101fd67ef636c9e20c2313af9823b /apps
parent2d16ba908478748a655a3dfceb361fd04fe952d9 (diff)
downloadnextcloud-server-ac55bac4610cc03445d50e845bdf205ed7288b78.tar.gz
nextcloud-server-ac55bac4610cc03445d50e845bdf205ed7288b78.zip
Fix test for ensureSystemAddressBookExists
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/carddav/carddavbackend.php5
-rw-r--r--apps/dav/lib/carddav/syncservice.php4
2 files changed, 4 insertions, 5 deletions
diff --git a/apps/dav/lib/carddav/carddavbackend.php b/apps/dav/lib/carddav/carddavbackend.php
index 762946a4fd2..7b8c43958b6 100644
--- a/apps/dav/lib/carddav/carddavbackend.php
+++ b/apps/dav/lib/carddav/carddavbackend.php
@@ -26,7 +26,6 @@ namespace OCA\DAV\CardDAV;
use OCA\DAV\Connector\Sabre\Principal;
use OCP\IDBConnection;
-use OCP\ILogger;
use Sabre\CardDAV\Backend\BackendInterface;
use Sabre\CardDAV\Backend\SyncSupport;
use Sabre\CardDAV\Plugin;
@@ -69,7 +68,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
/**
- * Returns the list of addressbooks for a specific user.
+ * Returns the list of address books for a specific user.
*
* Every addressbook should have the following properties:
* id - an arbitrary unique id
@@ -821,7 +820,6 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
$newUri = sha1($addressBook->getName() . $addressBook->getOwner());
-// $newUri = $addressBook->getName() . '-' . $addressBook->getOwner();
$query = $this->db->getQueryBuilder();
$query->insert('dav_shares')
->values([
@@ -982,6 +980,7 @@ class CardDavBackend implements BackendInterface, SyncSupport {
}
/**
+ * For shared address books the sharee is set in the ACL of the address book
* @param $addressBookId
* @param $acl
* @return array
diff --git a/apps/dav/lib/carddav/syncservice.php b/apps/dav/lib/carddav/syncservice.php
index 97a46d62501..d66d316f6f7 100644
--- a/apps/dav/lib/carddav/syncservice.php
+++ b/apps/dav/lib/carddav/syncservice.php
@@ -90,13 +90,13 @@ class SyncService {
* @throws \Sabre\DAV\Exception\BadRequest
*/
public function ensureSystemAddressBookExists($principal, $id, $properties) {
- $book = $this->backend->getAddressBooksByUri($id);
+ $book = $this->backend->getAddressBooksByUri($principal, $id);
if (!is_null($book)) {
return $book;
}
$this->backend->createAddressBook($principal, $id, $properties);
- return $this->backend->getAddressBooksByUri($id);
+ return $this->backend->getAddressBooksByUri($principal, $id);
}
/**