From 7ed4298ce79bf664dbfb427dc1e0decfcc1bc2f5 Mon Sep 17 00:00:00 2001 From: Miguel Ribeiro Date: Sun, 26 May 2024 10:24:37 +0200 Subject: [PATCH] fix password reset --- endpoints/cronjobs/sendresetpasswordemails.php | 3 ++- passwordreset.php | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/endpoints/cronjobs/sendresetpasswordemails.php b/endpoints/cronjobs/sendresetpasswordemails.php index 7bcb1a14c..6a87aae01 100644 --- a/endpoints/cronjobs/sendresetpasswordemails.php +++ b/endpoints/cronjobs/sendresetpasswordemails.php @@ -64,7 +64,8 @@ $mail->clearAddresses(); - echo "Verification email sent to " . $user['email'] . "
"; + echo "Password reset email sent to " . $user['email'] . "
"; + } } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}
"; diff --git a/passwordreset.php b/passwordreset.php index 153a2754c..4dbee5007 100644 --- a/passwordreset.php +++ b/passwordreset.php @@ -58,10 +58,11 @@ $requestMode = false; $resetMode = true; $token = $_GET['token']; + $email = $_GET['email']; $matchCount = "SELECT COUNT(*) FROM password_resets WHERE token = :token and email = :email"; $stmt = $db->prepare($matchCount); $stmt->bindValue(':token', $token, SQLITE3_TEXT); - $stmt->bindValue(':email', $_GET['email'], SQLITE3_TEXT); + $stmt->bindValue(':email', $email, SQLITE3_TEXT); $count = $stmt->execute()->fetchArray(SQLITE3_NUM); if ($count[0] == 0) { $hasErrorMessage = true; @@ -168,8 +169,8 @@ if (!$hideForm) { ?>
- - + +