diff options
-rw-r--r-- | core/Common.php | 3 | ||||
-rw-r--r-- | core/FrontController.php | 19 | ||||
-rw-r--r-- | plugins/Morpheus/templates/maintenance.tpl | 35 |
3 files changed, 39 insertions, 18 deletions
diff --git a/core/Common.php b/core/Common.php index 1ed8d48935..855d9f2639 100644 --- a/core/Common.php +++ b/core/Common.php @@ -1199,7 +1199,8 @@ class Common 401 => 'Unauthorized', 403 => 'Forbidden', 404 => 'Not Found', - 500 => 'Internal Server Error' + 500 => 'Internal Server Error', + 503 => 'Service Unavailable', ); if (!array_key_exists($code, $messages)) { diff --git a/core/FrontController.php b/core/FrontController.php index e697985f1e..d72cfe40b7 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -415,23 +415,8 @@ class FrontController extends Singleton if (Config::getInstance()->General['maintenance_mode'] == 1 && !Common::isPhpCliMode() ) { - $format = Common::getRequestVar('format', ''); - - $message = "Piwik is in scheduled maintenance. Please come back later." - . " The administrator can disable maintenance by editing the file piwik/config/config.ini.php and removing the following: " - . " maintenance_mode=1 "; - if (Config::getInstance()->Tracker['record_statistics'] == 0) { - $message .= ' and record_statistics=0'; - } - - $exception = new Exception($message); - // extend explain how to re-enable - // show error message when record stats = 0 - if (empty($format)) { - throw $exception; - } - $response = new ResponseBuilder($format); - echo $response->getResponseException($exception); + Common::sendResponseCode(503); + echo file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/Morpheus/templates/maintenance.tpl'); exit; } } diff --git a/plugins/Morpheus/templates/maintenance.tpl b/plugins/Morpheus/templates/maintenance.tpl new file mode 100644 index 0000000000..72cc8a7dc2 --- /dev/null +++ b/plugins/Morpheus/templates/maintenance.tpl @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <title>Piwik is undergoing maintenance</title> + <link rel="shortcut icon" href="plugins/CoreHome/images/favicon.ico" /> + <link rel="stylesheet" type="text/css" href="plugins/Morpheus/stylesheets/simple_structure.css" /> +</head> +<body id="simple"> + +<div class="logo"> + <img title="Piwik" alt="Piwik" src="plugins/Morpheus/images/logo-header.png"/> + <br/> + <a href='http://piwik.org/'>free/libre analytics platform</a> +</div> + +<div class="box"> + + <div class="header"> + <h1>Piwik is undergoing maintenance</h1> + </div> + + <div class="content"> + <p> + We will be back up and running again soon, so please try again later. Your analytics data will continue to be tracked as normal. Thank you for your patience. + </p> + </div> + + <div class="footer"> + </div> + +</div> + +</body> +</html> |