1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Better variable names

This commit is contained in:
Thomas Tanghus 2013-04-07 22:04:17 +02:00
parent fb385150dc
commit f160332dcb

View File

@ -39,25 +39,25 @@ class Backend extends \Sabre_CardDAV_Backend_Abstract {
*/ */
public function getAddressBooksForUser($principaluri) { public function getAddressBooksForUser($principaluri) {
$userid = $this->userIDByPrincipal($principaluri); $userid = $this->userIDByPrincipal($principaluri);
$user_addressbooks = array(); $addressBooks = array();
foreach($this->backends as $backend) { foreach($this->backends as $backend) {
$user_addressbooks = array_merge($user_addressbooks, $backend->getAddressBooksForUser($userid)); $addressBooks = array_merge($addressBooks, $backend->getAddressBooksForUser($userid));
} }
$addressbooks = array(); $addressbooks = array();
foreach($user_addressbooks as $i) { foreach($addressBooks as $addressBook) {
if($i['owner'] != \OCP\USER::getUser()) { if($addressBook['owner'] != \OCP\USER::getUser()) {
$i['uri'] = $i['uri'] . '_shared_by_' . $i['owner']; $addressBook['uri'] = $addressBook['uri'] . '_shared_by_' . $addressBook['owner'];
$i['displayname'] = $i['displayname'] . ' shared by ' . $i['owner']; $addressBook['displayname'] = $addressBook['displayname'];
} }
$addressbooks[] = array( $addressbooks[] = array(
'id' => $i['id'], 'id' => $addressBook['id'],
'uri' => $i['uri'], 'uri' => $addressBook['uri'],
'principaluri' => 'principals/'.$i['owner'], 'principaluri' => 'principals/'.$addressBook['owner'],
'{DAV:}displayname' => $i['displayname'], '{DAV:}displayname' => $addressBook['displayname'],
'{' . \Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description' '{' . \Sabre_CardDAV_Plugin::NS_CARDDAV . '}addressbook-description'
=> $i['description'], => $addressBook['description'],
'{http://calendarserver.org/ns/}getctag' => $i['lastmodified'], '{http://calendarserver.org/ns/}getctag' => $addressBook['lastmodified'],
); );
} }