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