diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-04-09 04:47:12 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-04-16 05:45:12 +0300 |
commit | 268e5c995b5a38c1f0b79c26dc9e7af5142c23e7 (patch) | |
tree | 42f1f1ce56b0fb9d4466852fbe3e52462ea471a7 /core | |
parent | 5bd47b2f7c202206d0decb18da64acf91bf72d13 (diff) |
#7620 Redesign of the maintenance mode
Diffstat (limited to 'core')
-rw-r--r-- | core/Common.php | 3 | ||||
-rw-r--r-- | core/FrontController.php | 19 |
2 files changed, 4 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; } } |