Skip to content

Commit fb07751

Browse files
committed
The password reset had better work now
1 parent b199570 commit fb07751

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

csb-accounts/auth-login.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@
7777
$_SESSION['errMsg'] = "found $name. ";
7878
rescueUser($db, "name", $name);
7979
} elseif ($db->checkUser('email', $email)) {
80-
echo "found email $email";
8180
$_SESSION['errMsg'] = "found $email. ";
82-
die("STILL BEING IMPLEMENTED"); // will go to rescueUser($db, "email", $email);
81+
rescueUser($db, "email", $email);
8382
} else {
8483
$_SESSION['errMsg'] = "No username or email matched: $name";
8584
header("Location: " . $ACC_URL."/rescue.php");
8685
}
8786
} elseif ($_POST['go'] == 'passwordReset') {
8887
$hashed = password_hash($_POST['password'], PASSWORD_DEFAULT);
89-
$query = "UPDATE users SET password ='".$hashed."', WHERE email = '".$_POST['email']."'";
88+
89+
$query = "UPDATE users SET password ='".$hashed."' WHERE email = '".$_POST['email']."'";
9090
$db->runQuery($query);
9191
header("Location: " . $ACC_URL."/rescue.php?go=success");
9292

csb-content/templates/rescue-template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<h1>Please enter your password</h1>
3333
<form action="<?php echo($ACC_URL."auth-login.php"); ?>" method="post">
3434
<input type="hidden" name="go" value="passwordReset">
35-
<input type="hidden" name="email" value="<?php echo $_POST['email']; ?>">
35+
<input type="hidden" name="email" value="<?php echo $_GET['go']; ?>">
3636
<div class="error-msg"><?php if (isset($_SESSION['errMsg'])) {
3737
echo "<span style=\"color: red;\">" . $_SESSION['errMsg'] . "</span>";
3838
unset($_SESSION['errMsg']);

0 commit comments

Comments
 (0)