Esempio n. 1
0
 /**
  * Checks for a new password and rehashes if necessary
  *
  * @param User                     $entity
  * @param PasswordEncoderInterface $encoder
  * @param string                   $submittedPassword
  *
  * @return string
  */
 public function checkNewPassword(User $entity, PasswordEncoderInterface $encoder, $submittedPassword)
 {
     if (!empty($submittedPassword)) {
         //hash the clear password submitted via the form
         return $encoder->encodePassword($submittedPassword, $entity->getSalt());
     }
     return $entity->getPassword();
 }
 /**
  * {@inheritDoc}
  */
 public function getSalt()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getSalt', array());
     return parent::getSalt();
 }