]> source.dussan.org Git - nextcloud-server.git/commitdiff
Check if app is enabled before loading in remote and public.php
authorBart Visscher <bartv@thisnet.nl>
Tue, 26 Jun 2012 20:24:16 +0000 (22:24 +0200)
committerBart Visscher <bartv@thisnet.nl>
Tue, 26 Jun 2012 23:05:12 +0000 (01:05 +0200)
public.php
remote.php

index 19c02a7a02799a9d71302e80df002eedeb847622..8846769f467bae9fedf231672add8c213d72f5d6 100644 (file)
@@ -10,6 +10,7 @@ if(is_null($file)){
 
 $parts=explode('/',$file,2);
 $app=$parts[0];
+OC_Util::checkAppEnabled($app);
 OC_App::loadApp($app);
 
 require_once(OC_App::getAppPath($app) .'/'. $parts[1]);
index e68a53800c7a5a6729e4327d6a516d9216c06a66..af48cd922c898c39570edac446b91818963305ea 100644 (file)
@@ -27,13 +27,24 @@ $file = ltrim ($file, '/');
 
 if(count(explode('/',$file)) == 2) {
        $parts=explode('/',$file);
-       $app=$parts[1];
-       OC_App::loadApp($app);
+       $app=$parts[0];
+       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.'/';
        require_once( OC::$SERVERROOT.'/'.$file);
 } else {
        $parts=explode('/', $file, 2);
        $app=$parts[0];
+       OC_Util::checkAppEnabled($app);
        OC_App::loadApp($app);
        $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/';
        require_once(OC_App::getAppPath($app) .'/'. $parts[1]);