]> source.dussan.org Git - nextcloud-server.git/commitdiff
404 error page
authorRobin Appelman <icewind1991@gmail.com>
Mon, 18 Apr 2011 11:16:32 +0000 (13:16 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Mon, 18 Apr 2011 11:16:49 +0000 (13:16 +0200)
files/download.php
img/weather-clear.png [new file with mode: 0644]
lib/files.php
plugins/publiclink/get.php
templates/404.php [new file with mode: 0644]

index f890036a32e5c58160b36faa908cf851c4da7db7..63209eaccbb2ae9fc4f1db2bb025f391ecf6fa9b 100644 (file)
@@ -33,6 +33,14 @@ if( !OC_USER::isLoggedIn()){
 
 $filename = $_GET["file"];
 
+if(!OC_FILESYSTEM::file_exists($filename)){
+       header("HTTP/1.0 404 Not Found");
+       $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+       $tmpl->assign('file',$filename);
+       $tmpl->printPage();
+       exit;
+}
+
 $ftype=OC_FILESYSTEM::getMimeType( $filename );
 
 header('Content-Type:'.$ftype);
diff --git a/img/weather-clear.png b/img/weather-clear.png
new file mode 100644 (file)
index 0000000..0acf7a9
Binary files /dev/null and b/img/weather-clear.png differ
index 642a7e7204950dc7050abadc42bc354d1efbd097..58bb04ec34689acb8654485e5498bb14686581ff 100644 (file)
@@ -146,7 +146,10 @@ class OC_FILES {
                        }
                }elseif($zip or !OC_FILESYSTEM::file_exists($filename)){
                        header("HTTP/1.0 404 Not Found");
-                       die('404 Not Found');
+                       $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+                       $tmpl->assign('file',$filename);
+                       $tmpl->printPage();
+//                     die('404 Not Found');
                }else{
                        header("HTTP/1.0 403 Forbidden");
                        die('403 Forbidden');
index cdfe42ef262150d02b29c8f84d31a2cdb9d2eea4..fb8a13b5417474e1ec0c1518b26af4dc24885f08 100644 (file)
@@ -70,7 +70,8 @@ if($path!==false){
        }
 }else{
        header("HTTP/1.0 404 Not Found");
-       echo '404 Not Found';
+       $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+       $tmpl->printPage();
        die();
 }
 ?>
\ No newline at end of file
diff --git a/templates/404.php b/templates/404.php
new file mode 100644 (file)
index 0000000..7696d16
--- /dev/null
@@ -0,0 +1,9 @@
+<div id="login">
+       <img src="<?php echo image_path("", "weather-clear.png"); ?>" alt="ownCloud" />
+       <ul>
+               <li class='error'>
+                       Error 404, Cloud not found<br/>
+                       <p class='hint'><?php if(isset($_['file'])) echo $_['file']?></p>
+               </li>
+       </ul>
+</div>
\ No newline at end of file