diff options
-rw-r--r-- | core/FrontController.php | 27 | ||||
-rw-r--r-- | plugins/Morpheus/templates/maintenance.tpl | 4 |
2 files changed, 23 insertions, 8 deletions
diff --git a/core/FrontController.php b/core/FrontController.php index d72cfe40b7..f6bb0ecf2a 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -18,6 +18,7 @@ use Piwik\Exception\DatabaseSchemaIsNewerThanCodebaseException; use Piwik\Http\ControllerResolver; use Piwik\Http\Router; use Piwik\Plugin\Report; +use Piwik\Plugins\CoreAdminHome\CustomLogo; use Piwik\Session; /** @@ -412,13 +413,27 @@ class FrontController extends Singleton protected function handleMaintenanceMode() { - if (Config::getInstance()->General['maintenance_mode'] == 1 - && !Common::isPhpCliMode() - ) { - Common::sendResponseCode(503); - echo file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/Morpheus/templates/maintenance.tpl'); - exit; + if ((Config::getInstance()->General['maintenance_mode'] != 1) || Common::isPhpCliMode()) { + return; + } + Common::sendResponseCode(503); + + $logoUrl = null; + $faviconUrl = null; + try { + $logo = new CustomLogo(); + $logoUrl = $logo->getHeaderLogoUrl(); + $faviconUrl = $logo->getPathUserFavicon(); + } catch (Exception $ex) { } + $logoUrl = $logoUrl ?: 'plugins/Morpheus/images/logo-header.png'; + $faviconUrl = $faviconUrl ?: 'plugins/CoreHome/images/favicon.ico'; + + $page = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/Morpheus/templates/maintenance.tpl'); + $page = str_replace('%logoUrl%', $logoUrl, $page); + $page = str_replace('%faviconUrl%', $faviconUrl, $page); + echo $page; + exit; } protected function handleSSLRedirection() diff --git a/plugins/Morpheus/templates/maintenance.tpl b/plugins/Morpheus/templates/maintenance.tpl index 72cc8a7dc2..d21ab44008 100644 --- a/plugins/Morpheus/templates/maintenance.tpl +++ b/plugins/Morpheus/templates/maintenance.tpl @@ -3,13 +3,13 @@ <head> <meta charset="utf-8"> <title>Piwik is undergoing maintenance</title> - <link rel="shortcut icon" href="plugins/CoreHome/images/favicon.ico" /> + <link rel="shortcut icon" href="%faviconUrl%" /> <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"/> + <img title="Piwik" alt="Piwik" src="%logoUrl%" /> <br/> <a href='http://piwik.org/'>free/libre analytics platform</a> </div> |