Skip to content

Commit

Permalink
fixed mistake for no secret question @ password lost
Browse files Browse the repository at this point in the history
  • Loading branch information
kokspflanze committed Oct 15, 2015
1 parent 4a3f9e2 commit b0dbec3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/PServerCMS/Service/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ public function lostPwConfirm( array $data, UserCodes $userCode )
$form = $this->getPasswordForm();
/** @var \PServerCMS\Form\PasswordFilter $filter */
$filter = $form->getInputFilter();
$filter->addAnswerValidation( $userCode->getUser() );
if ($this->getEntityManagerAnswer()->getAnswer4UserId($userCode->getUser()->getId())) {
$filter->addAnswerValidation( $userCode->getUser() );
}
$form->setData( $data );
if (!$form->isValid()) {
return false;
Expand Down Expand Up @@ -693,6 +695,14 @@ protected function handleAuth4UserLogin( SmallUserInterface $user )
return parent::handleAuth4UserLogin($user);
}

/**
* @return null|\PServerCMS\Entity\Repository\SecretAnswer
*/
protected function getEntityManagerAnswer()
{
return $this->getEntityManager()->getRepository($this->getEntityOptions()->getSecretAnswer());
}

/**
* @param UserInterface $entity
* @param string $plaintext
Expand Down

0 comments on commit b0dbec3

Please sign in to comment.