From ae095acb2b7fcfc1b5f41241e9a392822c303469 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 27 May 2013 07:56:55 +0200 Subject: [PATCH] Don't hardcode backend name in AddressBookController --- lib/controller/addressbookcontroller.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/controller/addressbookcontroller.php b/lib/controller/addressbookcontroller.php index 603d7465..b2c3bf6e 100644 --- a/lib/controller/addressbookcontroller.php +++ b/lib/controller/addressbookcontroller.php @@ -107,11 +107,11 @@ class AddressBookController extends BaseController { */ public function addAddressBook() { $app = new App($this->api->getUserId()); + $params = $this->request->urlParams; $response = new JSONResponse(); - $backend = $app->getBackend('local'); - // TODO: Check actual permissions + $backend = $app->getBackend($params['backend']); if(!$backend->hasAddressBookMethodFor(\OCP\PERMISSION_CREATE)) { throw new \Exception('Not implemented'); } @@ -157,7 +157,7 @@ class AddressBookController extends BaseController { $response = new JSONResponse(); - $backend = $app->getBackend('local'); + $backend = $app->getBackend($params['backend']); // TODO: Check actual permissions if(!$backend->hasAddressBookMethodFor(\OCP\PERMISSION_DELETE)) { throw new \Exception('Not implemented');