public function __construct() { parent::__construct(); $this->ci->load->model('recruiter_model', 'ion_auth_model'); $this->_extra_where = array('user_type' => 'recruiter'); $this->user_type = 'recruiter'; if (!$this->logged_in() && get_cookie('identity') && get_cookie('remember_code')) { $this->ci->recruiter_auth = $this; $this->ci->ion_auth_model->login_remembered_user(); } }
/** * Check route and if required - restrict access to it * * @param $route * @param Request $request * * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException */ public function routeRestrict($route, Request $request) { foreach ($this->expressions as $expression => $result) { if (!preg_match($expression, $route)) { continue; } try { if (is_callable($result)) { $result = $result($this->acl); } if ($result === false) { throw new AccessDeniedHttpException(); } } catch (Exception $e) { if (!$this->userManager->logged_in()) { $request->getSession()->set('forward_url', $request->getUri()); redirect('auth'); } throw $e; } break; } }