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;
}
/**
- * 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
}
$newUri = sha1($addressBook->getName() . $addressBook->getOwner());
-// $newUri = $addressBook->getName() . '-' . $addressBook->getOwner();
$query = $this->db->getQueryBuilder();
$query->insert('dav_shares')
->values([
}
/**
+ * For shared address books the sharee is set in the ACL of the address book
* @param $addressBookId
* @param $acl
* @return array
* @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);
}
/**