diff options
Diffstat (limited to 'core/FrontController.php')
-rw-r--r-- | core/FrontController.php | 27 |
1 files changed, 21 insertions, 6 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() |