diff --git a/forgot/forgot.php b/forgot/forgot.php
new file mode 100644
index 0000000..ad061e0
--- /dev/null
+++ b/forgot/forgot.php
@@ -0,0 +1,73 @@
+ 0) {
+ mysqli_query($conx, "UPDATE forgot_password SET uqid='$resetid' WHERE email_secure='$c_email'");
+ mysqli_query($conx, "UPDATE forgot_password SET tstamp='$tstamp' WHERE email_secure='$c_email'");
+ mysqli_query($conx, "UPDATE forgot_password SET ua='$useragent_r' WHERE email_secure='$c_email'");
+ mysqli_query($conx, "UPDATE forgot_password SET ip='$ipaddr_r' WHERE email_secure='$c_email'");
+ }
+ else {
+ # INSERT RESET DETAILS
+ $innss = mysqli_query($conx, "INSERT INTO forgot_password (ip,ua,tstamp,uqid,email_secure,username) VALUES ('$ipaddr_r','$useragent_r','$tstamp','$resetid','$c_email','$c_username')");
+ }
+ # PUSH OUT EMAIL
+ $to = $email_p;
+ $subject = "misdew.com password reset";
+ $txt = "$c_username,
+ A password reset was requested for your account.
+ Follow the link below to continue.
+ http://misdew.com/forgot/reset.php?k=$resetid
+
+ ";
+ $headers = "Content-Type: text/html; charset=utf-8";
+ mail($to,$subject,$txt,$headers);
+ $_SESSION['m4'] = "em_ss";
+ header("location: /forgot");
+ exit();
+}
+else {
+ $_SESSION['m3'] = "all_req";
+ header("location: /forgot");
+ exit();
+}
+session_destroy();
+?>
diff --git a/forgot/index.php b/forgot/index.php
index 8b13789..d700889 100644
--- a/forgot/index.php
+++ b/forgot/index.php
@@ -1 +1,87 @@
-
+
+
+
+
+ Misdew
+
+
+
+
+
+
+
+
+
+
+
+
+ You must enter an email.
";
+ unset($_SESSION['m3']);
+ }
+ elseif (isset($_SESSION['m']) == 'generr') {
+ echo "There was an error.
";
+ unset($_SESSION['m']);
+ }
+ elseif (isset($_SESSION['m2']) == 'e_inv') {
+ echo "The email you entered is not in a valid format.
";
+ unset($_SESSION['m2']);
+ }
+ elseif (isset($_SESSION['m4']) == 'em_ss') {
+ echo "We sent you an email.
";
+ unset($_SESSION['m4']);
+ }
+ elseif (isset($_SESSION['m5']) == 'ef_hef') {
+ echo "That reset link is invalid. Request a new one.
";
+ unset($_SESSION['m5']);
+ }
+ else {
+ echo "Enter the credentials associated with your account.
+
We will send you an email.
";
+ }
+ ?>
+
+
+ Still need help? Send an email to me@justa.us
+
+
+
+
diff --git a/forgot/r.php b/forgot/r.php
new file mode 100644
index 0000000..b2db405
--- /dev/null
+++ b/forgot/r.php
@@ -0,0 +1,63 @@
+= $tttstamp) {
+ mysqli_query($conx, "DELETE FROM forgot_password WHERE email_secure='$rs_email'");
+ $_SESSION['m5'] = "ef_hef";
+ header("location: /forgot");
+ exit();
+ }
+ if($newpass_p != $cnewpass_p) {
+ $_SESSION['m'] = "p_dnm";
+ header("location: /forgot/reset.php?k=$resetid_p");
+ exit();
+ }
+ function geddit($length = 50) {
+ return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
+ }
+ $newstr = geddit();
+ $newhashpass = hash("sha256",$rs_username.$newpass_p);
+ mysqli_query($conx, "UPDATE accounts SET password='$newhashpass' WHERE username='$rs_username'");
+ mysqli_query($conx, "UPDATE accounts SET rstringc='$newstr' WHERE username='$rs_username'");
+ mysqli_query($conx, "DELETE FROM forgot_password WHERE email_secure='$rs_email'");
+ # LOG USER IN TO ACCOUNT
+ $cs = mysqli_query($conx, "SELECT rstringa,rstringb,rstringc FROM accounts WHERE username='$rs_username'");
+ $cr = @mysqli_fetch_assoc($cs);
+ $c_rstringa = $cr['rstringa'];
+ $c_rstringb = $cr['rstringb'];
+ $c_rstringc = $cr['rstringc'];
+ setcookie("akgnxoPwqlIs", $c_rstringa, time()+3600*24*30, '/', '.misdew.com');
+ setcookie("LoILilzcnmwe", $c_rstringb, time()+3600*24*30, '/', '.misdew.com');
+ setcookie("puTtxXvbEkOo", $c_rstringc, time()+3600*24*30, '/', '.misdew.com');
+ header("location: /");
+ exit("");
+}
+else {
+ $_SESSION['m3'] = "all_req";
+ header("location: /forgot/reset.php?k=$resetid_p");
+ exit();
+}
+?>
diff --git a/forgot/reset.php b/forgot/reset.php
new file mode 100644
index 0000000..3ffb17e
--- /dev/null
+++ b/forgot/reset.php
@@ -0,0 +1,102 @@
+= $tttstamp) {
+ $dp = mysqli_query($conx, "DELETE FROM forgot_password WHERE email_secure='$rs_email'");
+ $_SESSION['m5'] = "ef_hef";
+ header("location: /forgot");
+ exit();
+ }
+}
+else {
+ header("location: /forgot");
+ exit();
+}
+?>
+
+
+
+ Misdew
+
+
+
+
+
+
+
+
+
+
+
+
+ All fields are required.
";
+ unset($_SESSION['m3']);
+ }
+ elseif (isset($_SESSION['m']) == 'p_dnm') {
+ echo "The passwords you entered did not match.
";
+ unset($_SESSION['m']);
+ }
+ else {
+ echo "Enter a new password for your account.
";
+ }
+ session_destroy();
+ ?>
+
+
+
+
+
+