diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2014-05-10 14:00:22 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-06-05 11:45:45 +0200 |
commit | ac7fb1b23e40e3075535ed5d4188219580b2386a (patch) | |
tree | a34585e85420dba68fb07456151b54e86ea4d785 /lib/private | |
parent | d0eb8f8668189d5fe82c9d783f30564d643ba604 (diff) | |
download | nextcloud-server-ac7fb1b23e40e3075535ed5d4188219580b2386a.tar.gz nextcloud-server-ac7fb1b23e40e3075535ed5d4188219580b2386a.zip |
Remove legacy routing code
The getfile routing code was absolutely legacy and not needed anymore. Additionally \OC::$REQUESTEDAPP was never set to the actually accessed application.
This commit removes the legacy routing code and ensures that $REQUESTEDAPP is always set so that other applications (e.g. the firewall or a two-factor authentication) can intercept the currently accessed app.
Testplan:
[x] Installation works
[x] Login with DB works
[x] Logout works
[x] Login with alternate backend works (tested with user_webdavauth)
[x] Other apps are accessible
[x] Redirect on login works (e.g. index.php?redirect_url=%2Fcore%2Findex.php%2Fsettings%2Fapps%3Finstalled)
[x] Personal settings are accessible
[x] Admin settings are accessible
[x] Sharing files works
[x] DAV works
[x] OC::$REQUESTEDAPP contains the requested application and can be intercepted by other applications
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/route/router.php | 3 | ||||
-rwxr-xr-x | lib/private/util.php | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/route/router.php b/lib/private/route/router.php index a72ac2bb3f1..e7c8ad9ebdd 100644 --- a/lib/private/route/router.php +++ b/lib/private/route/router.php @@ -188,8 +188,11 @@ class Router implements IRouter { if (substr($url, 0, 6) === '/apps/') { // empty string / 'apps' / $app / rest of the route list(, , $app,) = explode('/', $url, 4); + \OC::$REQUESTEDAPP = $app; $this->loadRoutes($app); } else if (substr($url, 0, 6) === '/core/' or substr($url, 0, 10) === '/settings/') { + \OC::$REQUESTEDAPP = $url; + \OC_App::loadApps(); $this->loadRoutes('core'); } else { $this->loadRoutes(); diff --git a/lib/private/util.php b/lib/private/util.php index 0daef78ce7f..dfdddd0e3ab 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -767,15 +767,12 @@ class OC_Util { $urlGenerator = \OC::$server->getURLGenerator(); if(isset($_REQUEST['redirect_url'])) { $location = urldecode($_REQUEST['redirect_url']); - } - else if (isset(OC::$REQUESTEDAPP) && !empty(OC::$REQUESTEDAPP)) { - $location = $urlGenerator->getAbsoluteURL('/index.php/apps/'.OC::$REQUESTEDAPP.'/index.php'); } else { $defaultPage = OC_Appconfig::getValue('core', 'defaultpage'); if ($defaultPage) { $location = $urlGenerator->getAbsoluteURL($defaultPage); } else { - $location = $urlGenerator->getAbsoluteURL('/index.php/files/index.php'); + $location = $urlGenerator->getAbsoluteURL('/index.php/apps/files'); } } OC_Log::write('core', 'redirectToDefaultPage: '.$location, OC_Log::DEBUG); |