diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-08-10 14:32:54 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-08-10 14:32:54 +0200 |
commit | 6d971d3b1d97e872751c2e5a1cc90c8392de8186 (patch) | |
tree | 6baee5fb4c6b72a05da24feea27e214f336b60aa | |
parent | be03ee29f0845c6e1146cad7f274951db4188566 (diff) | |
download | nextcloud-server-6d971d3b1d97e872751c2e5a1cc90c8392de8186.tar.gz nextcloud-server-6d971d3b1d97e872751c2e5a1cc90c8392de8186.zip |
Contacts: Better parameter names in addressbook share backend
-rw-r--r-- | apps/contacts/lib/share/addressbook.php | 15 |
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']; |