diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-04-18 13:16:32 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-04-18 13:16:49 +0200 |
commit | 7684585f49df8d83f3b1677279b5a13f61282a1f (patch) | |
tree | 52f3819f3cc2f90535256cf3f9261377cfb780c7 | |
parent | 5896fbd91005cd523bbcbae8a65eb7ce159edc95 (diff) | |
download | nextcloud-server-7684585f49df8d83f3b1677279b5a13f61282a1f.tar.gz nextcloud-server-7684585f49df8d83f3b1677279b5a13f61282a1f.zip |
404 error page
-rw-r--r-- | files/download.php | 8 | ||||
-rw-r--r-- | img/weather-clear.png | bin | 0 -> 21917 bytes | |||
-rw-r--r-- | lib/files.php | 5 | ||||
-rw-r--r-- | plugins/publiclink/get.php | 3 | ||||
-rw-r--r-- | templates/404.php | 9 |
5 files changed, 23 insertions, 2 deletions
diff --git a/files/download.php b/files/download.php index f890036a32e..63209eaccbb 100644 --- a/files/download.php +++ b/files/download.php @@ -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 Binary files differnew file mode 100644 index 00000000000..0acf7a9b2af --- /dev/null +++ b/img/weather-clear.png diff --git a/lib/files.php b/lib/files.php index 642a7e72049..58bb04ec346 100644 --- a/lib/files.php +++ b/lib/files.php @@ -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'); diff --git a/plugins/publiclink/get.php b/plugins/publiclink/get.php index cdfe42ef262..fb8a13b5417 100644 --- a/plugins/publiclink/get.php +++ b/plugins/publiclink/get.php @@ -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 index 00000000000..7696d16f8e2 --- /dev/null +++ b/templates/404.php @@ -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 |