]> git.mxchange.org Git - friendica.git/blob - mod/maintenance.php
Merge pull request #6977 from annando/fix-reshare
[friendica.git] / mod / maintenance.php
1 <?php
2 /**
3  * @file mod/maintenance.php
4  */
5 use Friendica\App;
6 use Friendica\Core\Config;
7 use Friendica\Core\L10n;
8 use Friendica\Core\Renderer;
9 use Friendica\Util\Strings;
10
11 function maintenance_content(App $a)
12 {
13         $reason = Config::get('system', 'maintenance_reason');
14
15         if (substr(Strings::normaliseLink($reason), 0, 7) == 'http://') {
16                 header("HTTP/1.1 307 Temporary Redirect");
17                 header("Location:".$reason);
18                 return;
19         }
20
21         header('HTTP/1.1 503 Service Temporarily Unavailable');
22         header('Status: 503 Service Temporarily Unavailable');
23         header('Retry-After: 600');
24
25         return Renderer::replaceMacros(Renderer::getMarkupTemplate('maintenance.tpl'), [
26                 '$sysdown' => L10n::t('System down for maintenance'),
27                 '$reason' => $reason
28         ]);
29 }