diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-16 06:42:09 -0700 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-16 06:42:09 -0700 |
commit | c3f7d22adc59949ad41c33d450b6d3e226cdefdb (patch) | |
tree | 07a528f19ee2aff7a0bd8cadb89de4b9851d5cbf /lib/private/appframework | |
parent | db31541fe13510ca4d1b752d7ac5a08ea8e89310 (diff) | |
parent | 8603f956ab5982251de51ea403ee93c840a987ac (diff) | |
download | nextcloud-server-c3f7d22adc59949ad41c33d450b6d3e226cdefdb.tar.gz nextcloud-server-c3f7d22adc59949ad41c33d450b6d3e226cdefdb.zip |
Merge pull request #5067 from owncloud/urlParams_fix
Get urlParams registered before Request is instantiated
Diffstat (limited to 'lib/private/appframework')
-rw-r--r-- | lib/private/appframework/app.php | 5 | ||||
-rw-r--r-- | lib/private/appframework/dependencyinjection/dicontainer.php | 4 | ||||
-rw-r--r-- | lib/private/appframework/middleware/security/securitymiddleware.php | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/lib/private/appframework/app.php b/lib/private/appframework/app.php index 7ff55bb809d..6d3effbf1fa 100644 --- a/lib/private/appframework/app.php +++ b/lib/private/appframework/app.php @@ -42,12 +42,9 @@ class App { * @param string $controllerName the name of the controller under which it is * stored in the DI container * @param string $methodName the method that you want to call - * @param array $urlParams an array with variables extracted from the routes * @param DIContainer $container an instance of a pimple container. */ - public static function main($controllerName, $methodName, array $urlParams, - IAppContainer $container) { - $container['urlParams'] = $urlParams; + public static function main($controllerName, $methodName, IAppContainer $container) { $controller = $container[$controllerName]; // initialize the dispatcher and run all the middleware before the controller diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php index e62b72fd973..523a4153e01 100644 --- a/lib/private/appframework/dependencyinjection/dicontainer.php +++ b/lib/private/appframework/dependencyinjection/dicontainer.php @@ -49,9 +49,10 @@ class DIContainer extends SimpleContainer implements IAppContainer{ * Put your class dependencies in here * @param string $appName the name of the app */ - public function __construct($appName){ + public function __construct($appName, $urlParams = array()){ $this['AppName'] = $appName; + $this['urlParams'] = $urlParams; $this->registerParameter('ServerContainer', \OC::$server); @@ -66,6 +67,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{ /** @var $c SimpleContainer */ /** @var $server IServerContainer */ $server = $c->query('ServerContainer'); + $server->registerParameter('urlParams', $c['urlParams']); return $server->getRequest(); }); diff --git a/lib/private/appframework/middleware/security/securitymiddleware.php b/lib/private/appframework/middleware/security/securitymiddleware.php index d6daf737bb4..d6dbcb6b8be 100644 --- a/lib/private/appframework/middleware/security/securitymiddleware.php +++ b/lib/private/appframework/middleware/security/securitymiddleware.php @@ -74,12 +74,12 @@ class SecurityMiddleware extends Middleware { // this will set the current navigation entry of the app, use this only // for normal HTML requests and not for AJAX requests - $this->api->activateNavigationEntry(); + //$this->api->activateNavigationEntry(); // security checks $isPublicPage = $annotationReader->hasAnnotation('PublicPage'); if(!$isPublicPage) { - if(!$this->api->isLoggedIn()) { + if(!\OC_User::isLoggedIn()) { throw new SecurityException('Current user is not logged in', Http::STATUS_UNAUTHORIZED); } |