]> source.dussan.org Git - nextcloud-server.git/commitdiff
make error 404 template usable as stand alone php file
authorRobin Appelman <icewind1991@gmail.com>
Mon, 18 Apr 2011 12:04:55 +0000 (14:04 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Mon, 18 Apr 2011 12:10:58 +0000 (14:10 +0200)
plugins/publiclink/get.php
templates/404.php

index fb8a13b5417474e1ec0c1518b26af4dc24885f08..41b10484f9b62c57ee0299c31d6b61c82032198d 100644 (file)
@@ -19,6 +19,13 @@ if($path!==false){
                $subPath='';
        }
        $path.=$subPath;
+       if(!OC_FILESYSTEM::file_exists($path)){
+               header("HTTP/1.0 404 Not Found");
+               $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+               $tmpl->assign('file',$subPath);
+               $tmpl->printPage();
+               exit;
+       }
        if(OC_FILESYSTEM::is_dir($path)){
                $files = array();
                $rootLength=strlen($root);
index 7696d16f8e24ce30c4e51e91585ee3395f9d5125..8909db29a4033ba3eb45a6871be0f90142673f87 100644 (file)
@@ -1,3 +1,13 @@
+<?php
+if(!isset($_)){//also provide standalone error page
+       require_once '../lib/base.php';
+       require( 'template.php' );
+       
+       $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+       $tmpl->printPage();
+       exit;
+}
+?>
 <div id="login">
        <img src="<?php echo image_path("", "weather-clear.png"); ?>" alt="ownCloud" />
        <ul>