Пример #1
0
 /**
  * Checks if the UserClient is the same as last session
  * @param  UserClient $client 
  * @return boolean
  */
 public function sameAsLastTime(UserClient $client)
 {
     return $client->isSame($this->client);
 }
 /**
  * Checks if this user, from this client, is logged in
  * @param UserClient $userClient, which contains information about the user's client, e.g. ip address
  * @return bool
  */
 public function isLoggedIn(UserClient $userClient)
 {
     if (isset($_SESSION[self::$sessionUserLocation])) {
         $user = $_SESSION[self::$sessionUserLocation];
         // Check if this user is the same that has logged in before
         if ($userClient->isSame($user) == false) {
             return false;
         }
         $this->setCurrentUser($user->getUserObject());
         return true;
     }
     return false;
 }