File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 77
77
$ _SESSION ['errMsg ' ] = "found $ name. " ;
78
78
rescueUser ($ db , "name " , $ name );
79
79
} elseif ($ db ->checkUser ('email ' , $ email )) {
80
- echo "found email $ email " ;
81
80
$ _SESSION ['errMsg ' ] = "found $ email. " ;
82
- die ( " STILL BEING IMPLEMENTED " ); // will go to rescueUser($db, "email", $email);
81
+ rescueUser ($ db , "email " , $ email );
83
82
} else {
84
83
$ _SESSION ['errMsg ' ] = "No username or email matched: $ name " ;
85
84
header ("Location: " . $ ACC_URL ."/rescue.php " );
86
85
}
87
86
} elseif ($ _POST ['go ' ] == 'passwordReset ' ) {
88
87
$ 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 ' ]."' " ;
90
90
$ db ->runQuery ($ query );
91
91
header ("Location: " . $ ACC_URL ."/rescue.php?go=success " );
92
92
Original file line number Diff line number Diff line change 32
32
<h1>Please enter your password</h1>
33
33
<form action="<?php echo ($ ACC_URL ."auth-login.php " ); ?> " method="post">
34
34
<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 ' ]; ?> ">
36
36
<div class="error-msg"><?php if (isset ($ _SESSION ['errMsg ' ])) {
37
37
echo "<span style= \"color: red; \"> " . $ _SESSION ['errMsg ' ] . "</span> " ;
38
38
unset($ _SESSION ['errMsg ' ]);
You can’t perform that action at this time.
0 commit comments