diff --git a/passwordReset.php b/passwordReset.php index f7ffbb7551..f06487b2de 100644 --- a/passwordReset.php +++ b/passwordReset.php @@ -25,6 +25,18 @@ $page->breadcrumbs->add(__('Password Reset')); +$page->return->addReturns([ + 'error0' => __('Email address not set.'), + 'error4' => __('Your request failed due to incorrect, non-existent or non-unique email address or username.'), + 'error3' => __('Email failed to send to {email}', ['email' => $_GET['email'] ?? '']), + 'error5' => __('Your request failed due to non-matching passwords.'), + 'error6' => __('Your request failed because your password does not meet the minimum requirements for strength.'), + 'error7' => __('Your request failed because your new password is the same as your current password.'), + 'fail2' => __('You do not have sufficient privileges to login.'), + 'fail9' => __('Your primary role does not support the ability to log into the specified year.'), + 'success0' => __('Password reset request successfully initiated, please check your email.'), +]); + $step = 1; if (isset($_GET['step']) and $_GET['step'] == 2) { $step = 2; @@ -36,19 +48,10 @@ get('systemName')); ?>

return->addReturns($returns); + $form = Form::create('action', $session->get('absoluteURL').'/passwordResetProcess.php?step=1'); + $form->addClass('disable-warnings'); $form->addHiddenValue('address', $session->get('address')); @@ -88,6 +91,8 @@ echo ''; $form = Form::create('action', $session->get('absoluteURL').'/passwordResetProcess.php?'.http_build_query($urlParams)); + $form->addClass('disable-warnings'); + $form->addHiddenValue('address', $session->get('address')); $form->addRow()->addHeading('Reset Password', __('Reset Password')); diff --git a/passwordResetProcess.php b/passwordResetProcess.php index 5a55feeec4..ebe360415e 100644 --- a/passwordResetProcess.php +++ b/passwordResetProcess.php @@ -43,7 +43,7 @@ $input = filter_var(trim($input), FILTER_SANITIZE_EMAIL); $step = $_GET['step'] ?? ''; -$URL = Url::fromRoute('passwordReset'); +$URL = Url::fromRoute('passwordReset')->withQueryParam('email', $input); $URLSuccess1 = Url::fromRoute(); if ($input == '' or ($step != 1 and $step != 2)) { @@ -62,7 +62,7 @@ } if ($result->rowCount() != 1) { - header("Location: {$URL->withReturn('error0')}"); + header("Location: {$URL->withReturn('error4')}"); exit(); } else { $row = $result->fetch();