]> source.dussan.org Git - nextcloud-server.git/commitdiff
add loading of files
authorGeorg Ehrke <dev@georgswebsite.de>
Thu, 19 Apr 2012 14:44:49 +0000 (16:44 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Thu, 19 Apr 2012 14:44:49 +0000 (16:44 +0200)
index.php
lib/base.php

index 1858865875b69078b50a6da4c9a905729489bee3..b85c49c76c26bb8e6925364d3dcb52822a8d665e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -57,7 +57,12 @@ elseif(OC_User::isLoggedIn()) {
                exit();
        }
        else {
-               OC::loadapp();
+               if(is_null(OC::$REQUESTEDFILE)){
+                       OC::loadapp();
+               }else{
+                       OC::loadfile();
+               }
+               
        }
 }
 
index c21ab9735935556824dace30f9aeaa75a14ecb50..2924a1da1822733bf7573cf755d37898db018190 100644 (file)
@@ -276,6 +276,17 @@ class OC{
                if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP)){
                        OC_App::loadApps();
                        require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/index.php');
+               }else{
+                       trigger_error('The requested App was not found.', E_USER_ERROR);
+               }
+       }
+       
+       public static function loadfile(){
+               if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){
+                       OC_App::loadApps();
+                       require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE);
+               }else{
+                       header('404 Not Found');
                }
        }