Skip to content

Commit ceb65fe

Browse files
committed
error pages
1 parent 35ea942 commit ceb65fe

7 files changed

Lines changed: 98 additions & 3 deletions

File tree

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<description>Custom theme for the ownCloud@CESNET server.</description>
66
<licence>AGPL</licence>
77
<author>Miroslav Bauer @ CESNET</author>
8-
<version>2.0.0a14</version>
8+
<version>2.0.0a15</version>
99
<types>
1010
<theme/>
1111
</types>

core/css/styles.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ button.primary:focus,
106106
}
107107

108108
.is-xsmall {
109-
font-size: 0.65rem !important;
109+
font-size: 0.75rem !important;
110110
}
111111

112112
.message {
@@ -118,6 +118,10 @@ button.primary:focus,
118118
color: white !important;
119119
}
120120

121+
.message.is-danger .message-body {
122+
border-color: #E60000 !important;
123+
}
124+
121125
.hero-title {
122126
font-size: 6rem !important;
123127
}

core/templates/403.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
// @codeCoverageIgnoreStart
3+
if (!isset($_)) {//also provide standalone error page
4+
require_once '../../lib/base.php';
5+
6+
$tmpl = new OC_Template('', '403', 'guest');
7+
$tmpl->printPage();
8+
exit;
9+
}
10+
// @codeCoverageIgnoreEnd
11+
?>
12+
<h1 class="title is-1"><?php p($l->t('Access forbidden')); ?></h1>
13+
<ul class="message is-danger">
14+
<li class='message-body'>
15+
<br>
16+
<p class='hint'><?php if (isset($_['file'])) {
17+
p($_['file']);
18+
}?></p>
19+
</li>
20+
</ul>
21+
<a class="button" <?php print_unescaped(\OC_User::getLogoutAttribute()); ?>"><?php p($l->t('Return to login page')); ?></a>

core/templates/404.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/** @var $_ array */
3+
/** @var $l \OCP\IL10N */
4+
/** @var $theme OC_Theme */
5+
// @codeCoverageIgnoreStart
6+
if (!isset($_)) {//also provide standalone error page
7+
require_once '../../lib/base.php';
8+
9+
$tmpl = new OC_Template('', '404', 'guest');
10+
$tmpl->printPage();
11+
exit;
12+
}
13+
// @codeCoverageIgnoreEnd
14+
?>
15+
<?php if (isset($_['content'])): ?>
16+
<?php print_unescaped($_['content']) ?>
17+
<?php else: ?>
18+
<h1 class="title is-1"><?php p($l->t('File not found')); ?></h1>
19+
<ul class="message is-danger">
20+
<li class="message-body">
21+
<p class="hint"><?php p($l->t('The specified document has not been found on the server.')); ?></p>
22+
<p class="hint"><a href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')) ?>"><?php p($l->t('You can click here to return to %s.', [$theme->getName()])); ?></a></p>
23+
</li>
24+
</ul>
25+
<?php endif; ?>

core/templates/error.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<h1 class="title is-1">Error</h1>
2+
<ul class="message is-danger">
3+
<?php foreach ($_["errors"] as $error):?>
4+
<li class='message-body'>
5+
<?php p($error['error']) ?><br>
6+
<?php if (isset($error['hint']) && $error['hint']): ?>
7+
<p class='hint'><?php p($error['hint']) ?></p>
8+
<?php endif;?>
9+
</li>
10+
<?php endforeach ?>
11+
</ul>
12+
<a class="button" <?php print_unescaped(\OC_User::getLogoutAttribute()); ?>"><?php p($l->t('Return to login page')); ?></a>

core/templates/exception.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/** @var array $_ */
3+
/** @var \OCP\IL10N $l */
4+
5+
style('core', ['styles', 'header']);
6+
?>
7+
<h2 class="title is-1"><?php p($l->t('Internal Server Error')) ?></h2>
8+
</div>
9+
<p class="subtitle is-4"><?php p($l->t('The server encountered an internal error and was unable to complete your request.')) ?></p>
10+
<p class="subtitle is-6"><?php p($l->t('Please contact the server administrator if this error reappears multiple times and include the technical details below in your report.')) ?></p>
11+
<p><?php print_unescaped($l->t('More details can be found in the <a target="_blank" rel="noreferrer" href="%s">server log</a>.', [link_to_docs('admin-logfiles')])); ?></p>
12+
<br>
13+
<h2 class="title is-3"><strong><?php p($l->t('Technical details')) ?></strong></h2>
14+
<div class="message is-danger">
15+
<ul class="message-body">
16+
<li><?php p($l->t('Remote Address: %s', $_['remoteAddr'])) ?></li>
17+
<li><?php p($l->t('Request ID: %s', $_['requestID'])) ?></li>
18+
<?php if ($_['debugMode']): ?>
19+
<li><?php p($l->t('Type: %s', $_['errorClass'])) ?></li>
20+
<li><?php p($l->t('Code: %s', $_['errorCode'])) ?></li>
21+
<li><?php p($l->t('Message: %s', $_['errorMsg'])) ?></li>
22+
<li><?php p($l->t('File: %s', $_['file'])) ?></li>
23+
<li><?php p($l->t('Line: %s', $_['line'])) ?></li>
24+
<?php endif; ?>
25+
</ul>
26+
</div>
27+
28+
<?php if ($_['debugMode']): ?>
29+
<br />
30+
<h2><strong><?php p($l->t('Trace')) ?></strong></h2>
31+
<pre><?php p($_['trace']) ?></pre>
32+
<?php endif; ?>
33+
</span>

core/templates/layout.guest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class="button is-primary is-inverted">
113113
</div>
114114
<footer class="hero-foot" role="contentinfo">
115115
<div class="content has-text-weight-light has-text-centered">
116-
<p>
116+
<p class="is-xsmall">
117117
<?php print_unescaped($theme->getLongFooter()); ?>
118118
</p>
119119
</div>

0 commit comments

Comments
 (0)