Inheritance: extends Nette\Object
Example #1
0
 public function formSucceeded($form, $values)
 {
     $user = $this->userRepository->findOneBy(['email' => $values->email]);
     if (!$user) {
         $form->addError("User with email " . $values->email . " does not exist.");
         return;
     }
     $hash = Nette\Utils\Random::generate(16);
     $this->passwordResetRepository->replace(["user_id" => $user->id, "hash" => $hash, "created" => new Nette\Utils\DateTime()]);
     $this->emailService->send($values->email, ['email' => $values->email, 'resetUrl' => $this->presenter->link("//Sign:in", ['newpasshash' => $hash])], 'passwordResetRequest.latte');
     $this->onFormSuccess($this);
 }