From 9410affdc06abdb0755e0b1215da8b68896ca5a6 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Sun, 19 May 2013 01:36:35 +0200 Subject: [PATCH] Make App::getBackend() non-static. --- lib/app.php | 2 +- lib/controller/addressbookcontroller.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/app.php b/lib/app.php index eb6507e1..94b42ec4 100644 --- a/lib/app.php +++ b/lib/app.php @@ -66,7 +66,7 @@ class App { * @param string $name * @return \Backend\AbstractBackend */ - static public function getBackend($name, $user = null) { + public public function getBackend($name, $user = null) { $name = $name ? $name : 'local'; if (isset(self::$backendClasses[$name])) { return new self::$backendClasses[$name]($user); diff --git a/lib/controller/addressbookcontroller.php b/lib/controller/addressbookcontroller.php index 726e5902..1e7c97d1 100644 --- a/lib/controller/addressbookcontroller.php +++ b/lib/controller/addressbookcontroller.php @@ -82,7 +82,7 @@ class AddressBookController extends BaseController { $response = new JSONResponse(); - $backend = App::getBackend('local', $this->api->getUserId()); + $backend = $app->getBackend('local'); // TODO: Check actual permissions if(!$backend->hasAddressBookMethodFor(\OCP\PERMISSION_CREATE)) { throw new \Exception('Not implemented'); @@ -128,7 +128,7 @@ class AddressBookController extends BaseController { $response = new JSONResponse(); - $backend = App::getBackend('local', $this->api->getUserId()); + $backend = $app->getBackend('local'); // TODO: Check actual permissions if(!$backend->hasAddressBookMethodFor(\OCP\PERMISSION_DELETE)) { throw new \Exception('Not implemented');