diff options
Diffstat (limited to 'public/catalog/controller/startup/maintenance.php')
-rw-r--r-- | public/catalog/controller/startup/maintenance.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/public/catalog/controller/startup/maintenance.php b/public/catalog/controller/startup/maintenance.php new file mode 100644 index 0000000..7c09cb0 --- /dev/null +++ b/public/catalog/controller/startup/maintenance.php @@ -0,0 +1,25 @@ +<?php +class ControllerStartupMaintenance extends Controller { + public function index() { + if ($this->config->get('config_maintenance')) { + // Route + if (isset($this->request->get['route']) && $this->request->get['route'] != 'startup/router') { + $route = $this->request->get['route']; + } else { + $route = $this->config->get('action_default'); + } + + $ignore = array( + 'common/language/language', + 'common/currency/currency' + ); + + // Show site if logged in as admin + $this->user = new Cart\User($this->registry); + + if ((substr($route, 0, 17) != 'extension/payment' && substr($route, 0, 3) != 'api') && !in_array($route, $ignore) && !$this->user->isLogged()) { + return new Action('common/maintenance'); + } + } + } +} |