summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-12 16:16:22 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-12 16:16:22 +0200
commit8c024947440e2f15a9effe5fe6d91e60e8571a07 (patch)
tree58c13528fe928c3f2674b003bad15caf4dc8f0df /lib
parent1025e451a7610a9e5b50e7e99e808cb2d1915236 (diff)
downloadnextcloud-server-8c024947440e2f15a9effe5fe6d91e60e8571a07.tar.gz
nextcloud-server-8c024947440e2f15a9effe5fe6d91e60e8571a07.zip
Routing: Prepare load funtions to be called from OC_Router
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php25
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/base.php b/lib/base.php
index a05d84fbae4..0d7e224d354 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -430,9 +430,12 @@ class OC{
OC_Response::setStatus(405);
return;
}
+ $app = OC::$REQUESTEDAPP;
+ $file = OC::$REQUESTEDFILE;
+ $param = array('app' => $app, 'file' => $file);
// Handle app css files
- if(substr(OC::$REQUESTEDFILE,-3) == 'css') {
- self::loadCSSFile();
+ if(substr($file,-3) == 'css') {
+ self::loadCSSFile($param);
return;
}
// Someone is logged in :
@@ -442,14 +445,12 @@ class OC{
OC_User::logout();
header("Location: ".OC::$WEBROOT.'/');
}else{
- $app = OC::$REQUESTEDAPP;
- $file = OC::$REQUESTEDFILE;
if(is_null($file)) {
- $file = 'index.php';
+ $param['file'] = 'index.php';
}
- $file_ext = substr($file, -3);
+ $file_ext = substr($param['file'], -3);
if ($file_ext != 'php'
- || !self::loadAppScriptFile($app, $file)) {
+ || !self::loadAppScriptFile($param)) {
header('HTTP/1.0 404 Not Found');
}
}
@@ -459,7 +460,9 @@ class OC{
self::handleLogin();
}
- protected static function loadAppScriptFile($app, $file) {
+ public static function loadAppScriptFile($param) {
+ $app = $param['app'];
+ $file = $param['file'];
$app_path = OC_App::getAppPath($app);
$file = $app_path . '/' . $file;
unset($app, $app_path);
@@ -470,9 +473,9 @@ class OC{
return false;
}
- protected static function loadCSSFile() {
- $app = OC::$REQUESTEDAPP;
- $file = OC::$REQUESTEDFILE;
+ public static function loadCSSFile($param) {
+ $app = $param['app'];
+ $file = $param['file'];
$app_path = OC_App::getAppPath($app);
if (file_exists($app_path . '/' . $file)) {
$app_web_path = OC_App::getAppWebPath($app);