Check if app is enabled before loading in remote and public.php

This commit is contained in:
Bart Visscher 2012-06-26 22:24:16 +02:00
parent dab58f3464
commit 153ee9dcfa
2 changed files with 14 additions and 2 deletions

View File

@ -10,6 +10,7 @@ if(is_null($file)){
$parts=explode('/',$file,2); $parts=explode('/',$file,2);
$app=$parts[0]; $app=$parts[0];
OC_Util::checkAppEnabled($app);
OC_App::loadApp($app); OC_App::loadApp($app);
require_once(OC_App::getAppPath($app) .'/'. $parts[1]); require_once(OC_App::getAppPath($app) .'/'. $parts[1]);

View File

@ -27,13 +27,24 @@ $file = ltrim ($file, '/');
if(count(explode('/',$file)) == 2) { if(count(explode('/',$file)) == 2) {
$parts=explode('/',$file); $parts=explode('/',$file);
$app=$parts[1]; $app=$parts[0];
OC_App::loadApp($app); switch ($app) {
case 'files':
OC_Util::checkAppEnabled($app);
OC_App::loadApp($app);
break;
case 'core':
break;
default:
OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
exit;
}
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
require_once( OC::$SERVERROOT.'/'.$file); require_once( OC::$SERVERROOT.'/'.$file);
} else { } else {
$parts=explode('/', $file, 2); $parts=explode('/', $file, 2);
$app=$parts[0]; $app=$parts[0];
OC_Util::checkAppEnabled($app);
OC_App::loadApp($app); OC_App::loadApp($app);
$baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
require_once(OC_App::getAppPath($app) .'/'. $parts[1]); require_once(OC_App::getAppPath($app) .'/'. $parts[1]);