示例#1
0
文件: User.php 项目: bengor/user
 /**
  * Checks if the remember password token is expired or not.
  *
  * @throws UserTokenNotFoundException when the remember password token does not exist
  *
  * @return bool
  */
 public function isRememberPasswordTokenExpired()
 {
     if (!$this->rememberPasswordToken instanceof UserToken) {
         throw new UserTokenNotFoundException();
     }
     return $this->rememberPasswordToken->isExpired($this->rememberPasswordTokenLifetime());
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function userOfRememberPasswordToken(UserToken $aRememberPasswordToken)
 {
     $statement = $this->execute('SELECT * FROM user WHERE remember_password_token_token = :rememberPasswordToken', ['rememberPasswordToken' => $aRememberPasswordToken->token()]);
     if ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
         return $this->buildUser($row);
     }
 }
示例#3
0
文件: UserToken.php 项目: bengor/user
 /**
  * Method that checks if the id given is equal to the current.
  *
  * @param UserToken $aToken The token
  *
  * @return bool
  */
 public function equals(UserToken $aToken)
 {
     return $this->token === $aToken->token();
 }