/** * @param \Nette\Application\UI\Form $form * @param string $resetKey */ protected function save(Form $form, $resetKey) { $user = $this->userRepository->findOneBy(array('resetKey' => $resetKey)); $user->removeResetKey($resetKey); $user->setPassword($form['password']->getValue()); $this->entityManager->flush(); $this->securityManager->sendNewPassword($user); }
public function confirmFormSuccess() { $this->securityManager->sendNewPassword($this->resetUser); $this->flashMessage($this->translator->translate('New password has been saved.'), 'success'); $this->redirect('this', array('key' => null)); }