private function validateUser()
 {
     // check to see if this is a valid user account
     $user = new User();
     if (!$user->checkLogin()) {
         $isActive = $user->isActive();
         $user->logout();
         if ($user->isError()) {
             switch ($user->getError()) {
                 case USER_SESSION_EXPIRED:
                     return Redirect::to('/login', 'session_invalidated')->send();
             }
         } elseif (!$isActive) {
             return Redirect::to('/login', 'account_deactivated')->send();
         } else {
             $v = new View('/frontend/user_error');
             $v->setViewTheme('concrete');
             $contents = $v->render();
             return $this->app->make(ResponseFactoryInterface::class)->forbidden($contents);
         }
     }
 }
 /**
  * @inheritdoc
  */
 public function view(View $view, $code = Response::HTTP_OK, $headers = array())
 {
     $changeContext = $this->shouldChangeContext();
     if ($changeContext) {
         $this->localization->pushActiveContext('site');
     }
     $contents = $view->render();
     if ($changeContext) {
         $this->localization->popActiveContext();
     }
     return $this->create($contents, $code, $headers);
 }
Example #3
0
 public function render($state = false)
 {
     return parent::render($state);
 }