public function recovery2FormSucceeded($form, $values) { $userData = $this->model->getBy(array("email" => $values->username)); if (!$userData) { $this->flashMessage("Neznámé uživatelské jméno.", "danger"); $this->redirect("password"); } else { try { $id = $userData->id; $this->userModel->setPassword($id, $values->password); $this->userModel->removeToken($id); $this->flashMessage("Změna hesla proběhla úspěšně.", "success"); } catch (Exception $e) { $this->flashMessage("Při nastavování hesla došlo k chybě.", "danger"); } } $this->redirect("in"); }