summaryrefslogtreecommitdiffstats
path: root/apps/contacts/lib/share/addressbook.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/lib/share/addressbook.php')
-rw-r--r--apps/contacts/lib/share/addressbook.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/contacts/lib/share/addressbook.php b/apps/contacts/lib/share/addressbook.php
index f719bccb78f..d90700d769f 100644
--- a/apps/contacts/lib/share/addressbook.php
+++ b/apps/contacts/lib/share/addressbook.php
@@ -8,6 +8,7 @@
class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
const FORMAT_ADDRESSBOOKS = 1;
+
/**
* @brief Get the source of the item to be stored in the database
* @param string Item
@@ -19,9 +20,9 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
*
* The formatItems() function will translate the source returned back into the item
*/
- public function isValidSource($item, $uid) {
- $addressbook = OC_Contacts_Addressbook::find( $item );
- if( $addressbook === false || $addressbook['userid'] != $uid) {
+ public function isValidSource($itemSource, $uidOwner) {
+ $addressbook = OC_Contacts_Addressbook::find( $itemSource );
+ if( $addressbook === false || $addressbook['userid'] != $uidOwner) {
return false;
}
return true;
@@ -37,8 +38,8 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
* This function needs to verify that the user does not already have an item with this name.
* If it does generate a new name e.g. name_#
*/
- public function generateTarget($item, $uid, $exclude = null) {
- $addressbook = OC_Contacts_Addressbook::find( $item );
+ public function generateTarget($itemSource, $shareWith, $exclude = null) {
+ $addressbook = OC_Contacts_Addressbook::find( $itemSource );
$user_addressbooks = array();
foreach(OC_Contacts_Addressbook::all($uid) as $user_addressbook) {
$user_addressbooks[] = $user_addressbook['displayname'];
@@ -77,9 +78,9 @@ class OC_Share_Backend_Addressbook implements OCP\Share_Backend_Collection {
return $addressbooks;
}
- public function getChildren($item) {
+ public function getChildren($itemSource) {
$query = OCP\DB::prepare('SELECT id FROM *PREFIX*contacts_cards WHERE addressbookid = ?');
- $result = $query->execute(array($item));
+ $result = $query->execute(array($itemSource));
$sources = array();
while ($contact = $result->fetchRow()) {
$sources[] = $contact['id'];