checkLogIn($f3); if( !$loginCheck ){ // no user found or LogIn timer expired $this->logOut($f3); } } /** * checks weather a user is currently logged in * @param \Base $f3 * @return bool */ private function checkLogIn($f3){ $loginCheck = false; if($f3->get(Api\User::SESSION_KEY_CHARACTER_TIME) > 0){ // check logIn time $logInTime = new \DateTime(); $logInTime->setTimestamp( $f3->get(Api\User::SESSION_KEY_CHARACTER_TIME) ); $now = new \DateTime(); $timeDiff = $now->diff($logInTime); $minutes = $timeDiff->days * 60 * 24 * 60; $minutes += $timeDiff->h * 60; $minutes += $timeDiff->i; if($minutes <= $f3->get('PATHFINDER.TIMER.LOGGED')){ $loginCheck = true; } } return $loginCheck; } }