summaryrefslogtreecommitdiffstats
path: root/lib/private/Route
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-05-17 10:12:33 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-07-18 11:09:04 +0200
commit94cd83ca00c5dd77b168bb21c494ff4fd8434ebc (patch)
tree68622e7b501f68387ddd894e1ad43f4bfdb33ca8 /lib/private/Route
parent1ff4b7f63d7dd80cb92a35beb95df2e0b6891476 (diff)
downloadnextcloud-server-94cd83ca00c5dd77b168bb21c494ff4fd8434ebc.tar.gz
nextcloud-server-94cd83ca00c5dd77b168bb21c494ff4fd8434ebc.zip
Make the router handle OCS AppFramework Routes
Diffstat (limited to 'lib/private/Route')
-rw-r--r--lib/private/Route/Router.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index 01262be390c..f7da827c3db 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -150,6 +150,11 @@ class Router implements IRouter {
$collection = $this->getCollection($app);
$collection->addPrefix('/apps/' . $app);
$this->root->addCollection($collection);
+
+ // Also add the OCS collection
+ $collection = $this->getCollection($app.'.ocs');
+ $collection->addPrefix('/ocsapp/apps/' . $app);
+ $this->root->addCollection($collection);
}
}
if (!isset($this->loadedApps['core'])) {
@@ -241,6 +246,13 @@ class Router implements IRouter {
$app = \OC_App::cleanAppId($app);
\OC::$REQUESTEDAPP = $app;
$this->loadRoutes($app);
+ } else if (substr($url, 0, 13) === '/ocsapp/apps/') {
+ // empty string / 'ocsapp' / 'apps' / $app / rest of the route
+ list(, , , $app,) = explode('/', $url, 5);
+
+ $app = \OC_App::cleanAppId($app);
+ \OC::$REQUESTEDAPP = $app;
+ $this->loadRoutes($app);
} else if (substr($url, 0, 6) === '/core/' or substr($url, 0, 10) === '/settings/') {
\OC::$REQUESTEDAPP = $url;
if (!\OC::$server->getConfig()->getSystemValue('maintenance', false) && !Util::needUpgrade()) {