Merge pull request #4225 from owncloud/better-404

More verbose 404, closes #3225
This commit is contained in:
Thomas Müller 2013-07-30 13:20:28 -07:00
commit d3e610f589
4 changed files with 40 additions and 6 deletions

View File

@ -0,0 +1,12 @@
#body-login .error-broken-link{
text-align:left;color:#fff;
}
#body-login .error-broken-link ul{
margin:10px 0 10px 0;
}
#body-login .error-broken-link ul li{
list-style: disc;list-style-position:inside;cursor:default;
}

View File

@ -234,6 +234,12 @@ if (isset($path)) {
} else {
OCP\Util::writeLog('share', 'could not resolve linkItem', \OCP\Util::DEBUG);
}
$errorTemplate = new OCP\Template('files_sharing', 'part.404', '');
$errorContent = $errorTemplate->fetchPage();
header('HTTP/1.0 404 Not Found');
OCP\Util::addStyle('files_sharing', '404');
$tmpl = new OCP\Template('', '404', 'guest');
$tmpl->assign('content', $errorContent);
$tmpl->printPage();

View File

@ -0,0 +1,12 @@
<ul>
<li class="error error-broken-link">
<p><?php p($l->t('Sorry, this link doesnt seem to work anymore.')) ?></p>
<p><?php p($l->t('Reasons might be:')); ?></p>
<ul>
<li><?php p($l->t('the item was removed')); ?></li>
<li><?php p($l->t('the link expired')); ?></li>
<li><?php p($l->t('sharing is disabled')); ?></li>
</ul>
<p><?php p($l->t('For more info, please ask the person who sent this link.')); ?></p>
</li>
</ul>

View File

@ -7,9 +7,13 @@ if(!isset($_)) {//also provide standalone error page
exit;
}
?>
<ul>
<li class='error'>
<?php p($l->t( 'Cloud not found' )); ?><br/>
<p class='hint'><?php if(isset($_['file'])) p($_['file'])?></p>
</li>
</ul>
<?php if (isset($_['content'])): ?>
<?php print_unescaped($_['content']) ?>
<?php else: ?>
<ul>
<li class="error">
<?php p($l->t( 'Cloud not found' )); ?><br/>
<p class='hint'><?php if(isset($_['file'])) p($_['file'])?></p>
</li>
</ul>
<?php endif; ?>