user->isValidToken($email, $token)) { $TeKe->add_system_message(_("Could not verify that this user requested a password reset."), "error"); forward("password_recovery"); } else if (empty($password) || empty($password_confirm)) { $TeKe->add_system_message(_("At least one of the parameters is empty."), 'error'); forward("password_reset"); } else if ($password != $password_confirm) { $TeKe->add_system_message(_("Passwords did not match."), 'error'); forward("password_reset"); } else { if ($TeKe->user->reset_password($email, $password)) { // TODO also log user in $TeKe->add_system_message(_("Your password was changed.")); } else { $TeKe->add_system_message(_("Error occured."), 'error'); forward("password_reset"); } } unset($_SESSION['input_values']); forward(""); ?>