mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-11-29 11:24:11 +01:00
Current adjustements with core. Still doesn't work with master
This commit is contained in:
parent
dfffa028fb
commit
d71d4c84fd
@ -32,7 +32,7 @@ $this->create('contacts_address_books_for_user', 'addressbooks/')
|
||||
function($params) {
|
||||
session_write_close();
|
||||
$dispatcher = new Dispatcher($params);
|
||||
$dispatcher->dispatch('AddressBookController', 'userAddressBooks');
|
||||
$dispatcher->dispatch('AddressBookController', 'userAddressBooks', $params);
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
namespace OCA\Contacts;
|
||||
|
||||
use OCP\AppFramework\IAppContainer,
|
||||
OC\AppFramework\Controller\Controller as BaseController,
|
||||
OCP\AppFramework\Controller as BaseController,
|
||||
OCP\IRequest,
|
||||
OCA\Contacts\App;
|
||||
|
||||
|
@ -57,7 +57,7 @@ class AddressBookController extends Controller {
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function getAddressBook() {
|
||||
\OCP\Util::writeLog('contacts', __METHOD__, \OCP\Util::DEBUG);
|
||||
\OCP\Util::writeLog('contacts', __METHOD__ . ' ' . print_r($this->request->urlParams, true), \OCP\Util::DEBUG);
|
||||
$params = $this->request->urlParams;
|
||||
|
||||
$addressBook = $this->app->getAddressBook($params['backend'], $params['addressBookId']);
|
||||
|
@ -30,11 +30,11 @@ class Dispatcher extends MainApp {
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
public function __construct(array $params) {
|
||||
parent::__construct('contacts', $params);
|
||||
public function __construct($params) {
|
||||
parent::__construct('contacts');
|
||||
$this->container = $this->getContainer();
|
||||
$this->container['urlParams'] = $params;
|
||||
$this->container->registerMiddleware(new HttpMiddleware($this->container->query('API')));
|
||||
$this->container->registerMiddleware(new HttpMiddleware($this->container));
|
||||
// TODO: Remove this once sorted out.
|
||||
// When querying the middleware dispatcher Request gets instantiated
|
||||
// but urlParams isn't set yet
|
||||
|
@ -24,25 +24,23 @@
|
||||
|
||||
namespace OCA\Contacts\Middleware;
|
||||
|
||||
use OCA\Contacts\Controller;
|
||||
use OC\AppFramework\Middleware\Middleware;
|
||||
use OC\AppFramework\Core\API;
|
||||
use OCA\Contacts\JSONResponse;
|
||||
use OCP\AppFramework\IMiddleWare;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use OCA\Contacts\Controller,
|
||||
OCA\Contacts\JSONResponse,
|
||||
OCP\AppFramework\Middleware,
|
||||
OCP\AppFramework\Http\Response;
|
||||
|
||||
/**
|
||||
* Used to intercept exceptions thrown in controllers and backends
|
||||
* and transform them into valid HTTP responses.
|
||||
*/
|
||||
class Http extends Middleware implements IMiddleware {
|
||||
class Http extends Middleware {
|
||||
|
||||
private $api;
|
||||
|
||||
/**
|
||||
* @param API $api an instance of the api
|
||||
* @param IAppContainer $app an instance of the app container
|
||||
*/
|
||||
public function __construct() {//API $api){
|
||||
public function __construct($app) {
|
||||
//$this->api = $api;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user