X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmaintenance.php;h=8e0197b868559beec31f2b9d6e83d02674771a0f;hb=3fc5c1ad840f98926319478a855dab3686a0ace3;hp=b50c94c9b93d9a6acb748cea3d3da6a680041ec1;hpb=8ec424325375aa923c7d2d78ac8ddcc352f09cff;p=friendica.git diff --git a/mod/maintenance.php b/mod/maintenance.php index b50c94c9b9..8e0197b868 100644 --- a/mod/maintenance.php +++ b/mod/maintenance.php @@ -1,7 +1,29 @@ t('System down for maintenance') - )); +function maintenance_content(App $a) +{ + $reason = Config::get('system', 'maintenance_reason'); + + if (substr(Strings::normaliseLink($reason), 0, 7) == 'http://') { + header("HTTP/1.1 307 Temporary Redirect"); + header("Location:".$reason); + return; + } + + header('HTTP/1.1 503 Service Temporarily Unavailable'); + header('Status: 503 Service Temporarily Unavailable'); + header('Retry-After: 600'); + + return Renderer::replaceMacros(Renderer::getMarkupTemplate('maintenance.tpl'), [ + '$sysdown' => L10n::t('System down for maintenance'), + '$reason' => $reason + ]); }