X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmaintenance.php;h=8727e4afb9f11f96c4efb25de694db22c7020e02;hb=daa1177e3a1e42b4c95e0a8759f1610942b952c7;hp=b50c94c9b93d9a6acb748cea3d3da6a680041ec1;hpb=dfa5183774e24fe2b1a355c9427372d4cd55ea70;p=friendica.git diff --git a/mod/maintenance.php b/mod/maintenance.php index b50c94c9b9..8727e4afb9 100644 --- a/mod/maintenance.php +++ b/mod/maintenance.php @@ -1,7 +1,27 @@ t('System down for maintenance') - )); +function maintenance_content(App $a) +{ + $reason = Config::get('system', 'maintenance_reason'); + + if (substr(normalise_link($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 replace_macros(get_markup_template('maintenance.tpl'), [ + '$sysdown' => L10n::t('System down for maintenance'), + '$reason' => $reason + ]); }