Ver código fonte

feat(exception-template): allow to link to specific documentation for how to retreive server log

Signed-off-by: Simon L <szaimen@e.mail.de>
undefined
Simon L. 1 mês atrás
pai
commit
34ae1adcc5

+ 5
- 0
config/config.sample.php Ver arquivo

*/ */
'upgrade.cli-upgrade-link' => '', 'upgrade.cli-upgrade-link' => '',


/**
* Allows to modify the exception server logs documentation link in order to link to a different documentation
*/
'documentation_url.server_logs' => '',

/** /**
* Set this Nextcloud instance to debugging mode * Set this Nextcloud instance to debugging mode
* *

+ 3
- 0
core/templates/exception.php Ver arquivo

<p><?php p($l->t('The server was unable to complete your request.')) ?></p> <p><?php p($l->t('The server was unable to complete your request.')) ?></p>
<p><?php p($l->t('If this happens again, please send the technical details below to the server administrator.')) ?></p> <p><?php p($l->t('If this happens again, please send the technical details below to the server administrator.')) ?></p>
<p><?php p($l->t('More details can be found in the server log.')) ?></p> <p><?php p($l->t('More details can be found in the server log.')) ?></p>
<?php if (isset($_['serverLogsDocumentation']) && $_['serverLogsDocumentation'] !== ''): ?>
<p><a href="<?php print_unescaped($_['serverLogsDocumentation']) ?>" target="_blank" rel="noopener"><?php p($l->t('See this documentation how to retreive them.')) ?></a></p>
<?php endif; ?>


<h3><?php p($l->t('Technical details')) ?></h3> <h3><?php p($l->t('Technical details')) ?></h3>
<ul> <ul>

+ 2
- 0
lib/private/legacy/OC_Template.php Ver arquivo

http_response_code($statusCode); http_response_code($statusCode);
try { try {
$debug = \OC::$server->getSystemConfig()->getValue('debug', false); $debug = \OC::$server->getSystemConfig()->getValue('debug', false);
$serverLogsDocumentation = \OC::$server->getSystemConfig()->getValue('documentation_url.server_logs', '');
$request = \OC::$server->getRequest(); $request = \OC::$server->getRequest();
$content = new \OC_Template('', 'exception', 'error', false); $content = new \OC_Template('', 'exception', 'error', false);
$content->assign('errorClass', get_class($exception)); $content->assign('errorClass', get_class($exception));
$content->assign('line', $exception->getLine()); $content->assign('line', $exception->getLine());
$content->assign('exception', $exception); $content->assign('exception', $exception);
$content->assign('debugMode', $debug); $content->assign('debugMode', $debug);
$content->assign('serverLogsDocumentation', $serverLogsDocumentation);
$content->assign('remoteAddr', $request->getRemoteAddress()); $content->assign('remoteAddr', $request->getRemoteAddress());
$content->assign('requestID', $request->getId()); $content->assign('requestID', $request->getId());
$content->printPage(); $content->printPage();

Carregando…
Cancelar
Salvar