Ejemplo n.º 1
0
 /**
  * Sets the password for a user.
  *
  * @param user   $user
  * @param string $password
  */
 private function doSetPassword(User $user, $password)
 {
     $user->setNonce($this->generator->generateString(64));
     $user->setPassword($this->passwordEncoder->encodePassword($password, $user->getNonce()));
     $user->setSaltedPassword(true);
 }
Ejemplo n.º 2
0
 /**
  * Sets the password for a user.
  *
  * @param user   $user
  * @param string $password
  */
 private function doSetPassword(User $user, $password)
 {
     $user->setNonce(base_convert(sha1(uniqid(mt_rand(), true)), 16, 36));
     $user->setPassword($this->passwordEncoder->encodePassword($password, $user->getNonce()));
     $user->setSaltedPassword(true);
 }
 /**
  * {@inheritDoc}
  */
 public function setPassword($password)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setPassword', array($password));
     return parent::setPassword($password);
 }