Example #1
0
 /**
  * event handler
  * @param $f3
  */
 function beforeroute($f3)
 {
     $loginCheck = $this->_checkLogIn();
     if (!$loginCheck) {
         // no user found or LogIn timer expired
         $this->logOut($f3);
     }
     parent::beforeroute($f3);
 }
Example #2
0
 /**
  * event handler
  * @param $f3
  */
 function beforeroute($f3)
 {
     parent::beforeroute($f3);
     // Any CMS route of a child class of this one, requires a
     // valid logged in user!
     $loginCheck = $this->_checkLogIn();
     if (!$loginCheck) {
         // no user found or LogIn timer expired
         $this->logOut($f3);
     }
 }
Example #3
0
 /**
  * event handler
  * @param \Base $f3
  */
 function beforeroute(\Base $f3)
 {
     parent::beforeroute($f3);
     // Any route/endpoint of a child class of this one,
     // requires a valid logged in user!
     $loginCheck = $this->checkLogTimer($f3);
     if (!$loginCheck) {
         // no user found or login timer expired
         $this->logout($f3);
         if ($f3->get('AJAX')) {
             // unauthorized request
             $f3->status(403);
         } else {
             // redirect to landing page
             $f3->reroute('@login');
         }
         // die() triggers unload() function
         die;
     }
 }