Esempio n. 1
0
 /**
  * Static function for checking hashed password (as required by Doctrine)
  *
  * @param User $user The identity object
  * @param string $passwordGiven Password provided to be verified
  * @return boolean true if the password was correct, else, returns false
  */
 public static function verifyHashedPassword(User $user, $passwordGiven)
 {
     $bcrypt = new Bcrypt(array('cost' => 10));
     $bcrypt->setSalt($user->getUserPasswordSalt());
     return $bcrypt->verify($passwordGiven, $user->getUserPassword());
 }