/** * __Construct * * */ public function __construct() { parent::__construct(); $this->load->library(array('grocery_CRUD', 'auth')); // check for logged in user if ($this->router->fetch_class() != 'TT_login' && $this->router->fetch_class() != 'login' && $this->router->fetch_class() != 'error' && $this->router->fetch_class() != 'TT_error' && !$this->auth->check_login()) { $this->auth->save_prelogin_url(); redirect(site_url('admin/login')); } // check controller/method auth - user groups if ($this->router->fetch_class() != 'TT_login' && $this->router->fetch_class() != 'login' && $this->router->fetch_class() != 'error' && $this->router->fetch_class() != 'TT_error' && !$this->auth->check_auth_user_groups_for_controller($this->auth_user_groups)) { show_error('Forbidden.', 403); } // Still logged in; update the native session. $this->auth->set_native_session('auth_logged_in', TRUE); }
/** * Contructor. Loads all languages and trigger event pre_controller. */ public function __construct() { parent::__construct(); $this->event->trigger('pre_controller'); $this->_cms_language(); }