1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-18 07:52:21 +01:00

Contacts: Use AddressBook to access Contact in controller.

This commit is contained in:
Thomas Tanghus 2013-05-04 22:49:36 +02:00
parent 58031b7d86
commit 52a72a080b

View File

@ -116,11 +116,8 @@ class ContactController extends BaseController {
$response->debug(__METHOD__ . ', checksum: ' . print_r($checksum, true)); $response->debug(__METHOD__ . ', checksum: ' . print_r($checksum, true));
$app = new App($request->parameters['user']); $app = new App($request->parameters['user']);
$contact = $app->getContact( $addressBook = $app->getAddressBook($params['backend'], $params['addressbookid']);
$request->parameters['backend'], $contact = $addressBook->getChild($params['contactid']);
$request->parameters['addressbookid'],
$request->parameters['contactid']
);
if(!$contact) { if(!$contact) {
$response->bailOut(App::$l10n->t('Couldn\'t find contact.')); $response->bailOut(App::$l10n->t('Couldn\'t find contact.'));
@ -176,11 +173,9 @@ class ContactController extends BaseController {
$response->debug(__METHOD__ . ', checksum: ' . print_r($checksum, true)); $response->debug(__METHOD__ . ', checksum: ' . print_r($checksum, true));
$response->debug(__METHOD__ . ', parameters: ' . print_r($parameters, true)); $response->debug(__METHOD__ . ', parameters: ' . print_r($parameters, true));
$contact = $app->getContact( $addressBook = $app->getAddressBook($params['backend'], $params['addressbookid']);
$request->parameters['backend'], $response->debug(__METHOD__ . ', addressBook: ' . print_r($addressBook, true));
$request->parameters['addressbookid'], $contact = $addressBook->getChild($params['contactid']);
$request->parameters['contactid']
);
if(!$contact) { if(!$contact) {
$response->bailOut(App::$l10n->t('Couldn\'t find contact.')); $response->bailOut(App::$l10n->t('Couldn\'t find contact.'));