shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

maintenance.php (780B)


      1 <?php
      2 class ControllerStartupMaintenance extends Controller {
      3 	public function index() {
      4 		if ($this->config->get('config_maintenance')) {
      5 			// Route
      6 			if (isset($this->request->get['route']) && $this->request->get['route'] != 'startup/router') {
      7 				$route = $this->request->get['route'];
      8 			} else {
      9 				$route = $this->config->get('action_default');
     10 			}			
     11 			
     12 			$ignore = array(
     13 				'common/language/language',
     14 				'common/currency/currency'
     15 			);
     16 			
     17 			// Show site if logged in as admin
     18 			$this->user = new Cart\User($this->registry);
     19 
     20 			if ((substr($route, 0, 17) != 'extension/payment' && substr($route, 0, 3) != 'api') && !in_array($route, $ignore) && !$this->user->isLogged()) {
     21 				return new Action('common/maintenance');
     22 			}
     23 		}
     24 	}
     25 }