From 98be6617050307b2cb88c01e634840734de7d751 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 1 Jan 2026 11:37:12 +0100 Subject: [PATCH] [WIP] Refactor account lost - fixes --- system/pages/account/lost/recovery-key/step-1.php | 2 ++ system/pages/account/lost/recovery-key/step-2.php | 4 ++-- system/pages/account/lost/recovery-key/step-3.php | 2 +- system/templates/account/lost/recovery-key.step-1.html.twig | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/system/pages/account/lost/recovery-key/step-1.php b/system/pages/account/lost/recovery-key/step-1.php index 6d55b633..6ced04fc 100644 --- a/system/pages/account/lost/recovery-key/step-1.php +++ b/system/pages/account/lost/recovery-key/step-1.php @@ -6,6 +6,7 @@ csrfProtect(); $title = 'Lost Account'; $nick = $_REQUEST['nick'] ?? ''; +$key = $_REQUEST['key'] ?? ''; if($account->isLoaded()) { $account_key = $account->getCustomField('key'); @@ -13,6 +14,7 @@ if($account->isLoaded()) { if(!empty($account_key)) { $twig->display('account/lost/recovery-key.step-1.html.twig', [ 'nick' => $nick, + 'key' => $key, ]); } else { diff --git a/system/pages/account/lost/recovery-key/step-2.php b/system/pages/account/lost/recovery-key/step-2.php index b61c39bc..347e9612 100644 --- a/system/pages/account/lost/recovery-key/step-2.php +++ b/system/pages/account/lost/recovery-key/step-2.php @@ -6,7 +6,7 @@ csrfProtect(); $title = 'Lost Account'; $key = $_REQUEST['key'] ?? ''; -$nick = $_POST['nick'] ?? ''; +$nick = $_REQUEST['nick'] ?? ''; $player = new OTS_Player(); $account = new OTS_Account(); @@ -45,5 +45,5 @@ if (!empty($errors)) { $twig->display('account.back_button.html.twig', [ 'new_line' => true, 'center' => true, - 'action' => getLink('account/lost/step-1') . '?action=recovery-key&nick=' . urlencode($nick), + 'action' => getLink('account/lost/step-1') . '?action=recovery-key&nick=' . urlencode($nick) . '&key=' . urlencode($key), ]); diff --git a/system/pages/account/lost/recovery-key/step-3.php b/system/pages/account/lost/recovery-key/step-3.php index 2cef67bc..6fbc7a64 100644 --- a/system/pages/account/lost/recovery-key/step-3.php +++ b/system/pages/account/lost/recovery-key/step-3.php @@ -99,5 +99,5 @@ if (!empty($errors)) { $twig->display('account.back_button.html.twig', [ 'new_line' => true, 'center' => true, - 'action' => getLink('account/lost/step-1') . '?action=recovery-key&nick=' . urlencode($nick), + 'action' => getLink('account/lost/recovery-key/step-2') . '?nick=' . urlencode($nick) . '&key=' . urlencode($key), ]); diff --git a/system/templates/account/lost/recovery-key.step-1.html.twig b/system/templates/account/lost/recovery-key.step-1.html.twig index 77484b56..31a097b0 100644 --- a/system/templates/account/lost/recovery-key.step-1.html.twig +++ b/system/templates/account/lost/recovery-key.step-1.html.twig @@ -30,7 +30,7 @@ If you enter right recovery key you will see form to set new e-mail and password - +