summaryrefslogtreecommitdiffstats
path: root/lib/private/api.php
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-07-01 16:45:00 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-07-01 16:45:00 +0200
commit5a588333b236519aed449a309be818d0686edb3a (patch)
tree5df197e9501bf79b1abcc7253987df53c5746ba3 /lib/private/api.php
parentdd20b9f6726db4ddc2d5905705e01544f4f4fd08 (diff)
downloadnextcloud-server-5a588333b236519aed449a309be818d0686edb3a.tar.gz
nextcloud-server-5a588333b236519aed449a309be818d0686edb3a.zip
introduce and use getCurrentConnection()
Diffstat (limited to 'lib/private/api.php')
-rw-r--r--lib/private/api.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/api.php b/lib/private/api.php
index 75d87b333d5..f5576af2ad8 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -65,6 +65,7 @@ class OC_API {
$name = strtolower($method).$url;
$name = str_replace(array('/', '{', '}'), '_', $name);
if(!isset(self::$actions[$name])) {
+ $oldCollection = OC::$server->getRouter()->getCurrentCollection();
OC::$server->getRouter()->useCollection('ocs');
OC::$server->getRouter()->create($name, $url)
->method($method)
@@ -72,7 +73,7 @@ class OC_API {
->requirements($requirements)
->action('OC_API', 'call');
self::$actions[$name] = array();
- OC::$server->getRouter()->useCollection('root');
+ OC::$server->getRouter()->useCollection($oldCollection);
}
self::$actions[$name][] = array('app' => $app, 'action' => $action, 'authlevel' => $authLevel);
}