@@ -16,57 +16,57 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class Offline |
| 18 | 18 | { |
| 19 | - /** |
|
| 20 | - * Determines if the tool is offline |
|
| 21 | - * @return bool |
|
| 22 | - */ |
|
| 23 | - public static function isOffline() |
|
| 24 | - { |
|
| 25 | - global $dontUseDb; |
|
| 19 | + /** |
|
| 20 | + * Determines if the tool is offline |
|
| 21 | + * @return bool |
|
| 22 | + */ |
|
| 23 | + public static function isOffline() |
|
| 24 | + { |
|
| 25 | + global $dontUseDb; |
|
| 26 | 26 | |
| 27 | - return (bool)$dontUseDb; |
|
| 28 | - } |
|
| 27 | + return (bool)$dontUseDb; |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Gets the offline message |
|
| 32 | - * |
|
| 33 | - * @param bool $external |
|
| 34 | - * @param null $message |
|
| 35 | - * |
|
| 36 | - * @return string |
|
| 37 | - */ |
|
| 38 | - public static function getOfflineMessage($external, $message = null) |
|
| 39 | - { |
|
| 40 | - global $dontUseDbCulprit, $dontUseDbReason, $baseurl; |
|
| 30 | + /** |
|
| 31 | + * Gets the offline message |
|
| 32 | + * |
|
| 33 | + * @param bool $external |
|
| 34 | + * @param null $message |
|
| 35 | + * |
|
| 36 | + * @return string |
|
| 37 | + */ |
|
| 38 | + public static function getOfflineMessage($external, $message = null) |
|
| 39 | + { |
|
| 40 | + global $dontUseDbCulprit, $dontUseDbReason, $baseurl; |
|
| 41 | 41 | |
| 42 | - $smarty = new Smarty(); |
|
| 43 | - $smarty->assign("baseurl", $baseurl); |
|
| 44 | - $smarty->assign("alerts", []); |
|
| 45 | - $smarty->assign("toolversion", Environment::getToolVersion()); |
|
| 42 | + $smarty = new Smarty(); |
|
| 43 | + $smarty->assign("baseurl", $baseurl); |
|
| 44 | + $smarty->assign("alerts", []); |
|
| 45 | + $smarty->assign("toolversion", Environment::getToolVersion()); |
|
| 46 | 46 | |
| 47 | - if (!headers_sent()) { |
|
| 48 | - header("HTTP/1.1 503 Service Unavailable"); |
|
| 49 | - } |
|
| 47 | + if (!headers_sent()) { |
|
| 48 | + header("HTTP/1.1 503 Service Unavailable"); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - if ($external) { |
|
| 52 | - return $smarty->fetch("offline/external.tpl"); |
|
| 53 | - } |
|
| 54 | - else { |
|
| 55 | - $hideCulprit = true; |
|
| 51 | + if ($external) { |
|
| 52 | + return $smarty->fetch("offline/external.tpl"); |
|
| 53 | + } |
|
| 54 | + else { |
|
| 55 | + $hideCulprit = true; |
|
| 56 | 56 | |
| 57 | - // Use the provided message if possible |
|
| 58 | - if ($message === null) { |
|
| 59 | - $hideCulprit = false; |
|
| 60 | - $message = $dontUseDbReason; |
|
| 61 | - } |
|
| 57 | + // Use the provided message if possible |
|
| 58 | + if ($message === null) { |
|
| 59 | + $hideCulprit = false; |
|
| 60 | + $message = $dontUseDbReason; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - $smarty->assign("hideCulprit", $hideCulprit); |
|
| 64 | - $smarty->assign("dontUseDbCulprit", $dontUseDbCulprit); |
|
| 65 | - $smarty->assign("dontUseDbReason", $message); |
|
| 66 | - $smarty->assign("alerts", array()); |
|
| 67 | - $smarty->assign('currentUser', User::getCommunity()); |
|
| 63 | + $smarty->assign("hideCulprit", $hideCulprit); |
|
| 64 | + $smarty->assign("dontUseDbCulprit", $dontUseDbCulprit); |
|
| 65 | + $smarty->assign("dontUseDbReason", $message); |
|
| 66 | + $smarty->assign("alerts", array()); |
|
| 67 | + $smarty->assign('currentUser', User::getCommunity()); |
|
| 68 | 68 | |
| 69 | - return $smarty->fetch("offline/internal.tpl"); |
|
| 70 | - } |
|
| 71 | - } |
|
| 69 | + return $smarty->fetch("offline/internal.tpl"); |
|
| 70 | + } |
|
| 71 | + } |
|
| 72 | 72 | } |