/** * @param string $username * @return void */ public function sendResetLinkAction($username) { $userData = $this->crowdClient->getUser($username); if ($userData !== NULL) { $token = $this->doubleOptInHelper->generateToken($userData['email'], 'id.neos.io reset password', $userData); $this->doubleOptInHelper->setRequest($this->request); $this->doubleOptInHelper->sendActivationMail($userData['email'], $token); $this->redirect('resetPasswordMailSent'); } //TODO: error handling }
/** * {@inheritdoc} */ protected function isValid($value) { if (!$value instanceof UserDto) { $this->addError('Value must be of type UserDto', 1436254418); } if ($value->getPassword() !== $value->getPasswordConfirmation()) { $this->result->forProperty('passwordConfirmation')->addError(new Error('Password does not match confirmation', 1436254655)); } if ($this->crowdClient->getUser($value->getUsername()) !== NULL) { $this->result->forProperty('username')->addError(new Error('The chosen username is not available', 1436267801)); } }