404 error page

This commit is contained in:
Robin Appelman 2011-04-18 13:16:32 +02:00
parent 5896fbd910
commit 7684585f49
5 changed files with 23 additions and 2 deletions

View 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);

BIN
img/weather-clear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View 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');

View 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();
}
?>

9
templates/404.php Normal file
View File

@ -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>