2013-01-14 23:48:01 +00:00
|
|
|
<?php
|
2016-02-07 14:11:34 +00:00
|
|
|
|
2017-04-30 04:07:00 +00:00
|
|
|
use Friendica\App;
|
2017-04-30 04:01:26 +00:00
|
|
|
use Friendica\Core\Config;
|
2017-03-19 13:24:07 +00:00
|
|
|
|
2017-01-09 12:14:25 +00:00
|
|
|
function maintenance_content(App $a) {
|
2017-03-19 19:03:09 +00:00
|
|
|
|
|
|
|
$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;
|
|
|
|
}
|
|
|
|
|
2016-10-02 13:52:52 +00:00
|
|
|
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
|
|
|
header('Status: 503 Service Temporarily Unavailable');
|
|
|
|
header('Retry-After: 600');
|
|
|
|
|
2018-01-15 13:05:12 +00:00
|
|
|
return replace_macros(get_markup_template('maintenance.tpl'), [
|
2017-03-19 13:24:07 +00:00
|
|
|
'$sysdown' => t('System down for maintenance'),
|
2017-03-19 19:03:09 +00:00
|
|
|
'$reason' => $reason
|
2018-01-15 13:05:12 +00:00
|
|
|
]);
|
2013-01-14 23:48:01 +00:00
|
|
|
}
|