Beispiel #1
0
 /**
  * Static function for checking hashed password (as required by Doctrine)
  *
  * @param snUser\Entity\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));
     return $bcrypt->verify($passwordGiven, $user->getPassword());
 }
Beispiel #2
0
 /**
  * Remove myFriend
  *
  * @param  User $user
  * @return User
  */
 public function removeMyFriend(\BkdUser\Entity\User $user)
 {
     $user->removeFriendWithMe($this);
     // synchronously updating inverse side.
     $this->myFriends->removeElement($user);
     return $this;
 }