Guest User

Untitled

a guest
Jan 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php
  2. class ControllerCommonCheckLogin extends Controller {
  3.     public function index() {
  4.         // Require to be logged in
  5.         if (!$this->customer->isLogged()) {
  6.        
  7.             $route = '';
  8.            
  9.             if (isset($this->request->get['route'])) {
  10.                 $part = explode('/', $this->request->get['route']);
  11.                
  12.                 if (isset($part[0])) {
  13.                     $route .= $part[0];
  14.                 }          
  15.             }
  16.            
  17.             // Show site if logged in as admin
  18.             $this->load->library('user');
  19.            
  20.             $this->user = new User($this->registry);
  21.    
  22.             if ((($route != 'payment') || ($route != 'account')) && !$this->user->isLogged()) {
  23.                 return $this->forward('common/maintenance/info');
  24.             }
  25.         }
  26.     }
  27. }
  28. ?>
Add Comment
Please, Sign In to add comment