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');