Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. <?php
  2. if(!empty($_POST['Code']))
  3. {
  4. $result=mysql_query("SELECT * FROM `ForgotSerial` WHERE `Serial` = '".RES($_POST['Code'])."' LIMIT 1");
  5. if(mysql_num_rows($result))
  6. {
  7. $row=mysql_fetch_assoc($result);
  8. $Des->Success("You have been sent a new password. Please check your E-Mail. <a href=\"control.php?login\">Click here</a> to be redirected back to the login area.");
  9. $NewPass=rand(10000000000,99999999999);
  10. $Mail->Send($row['CusID'],"New Gta-multi Account Password", "Hello %FULLNAME%,
  11.  
  12. Your password has been successfully changed.
  13. You can now login with the new password stated below. Be sure to change it right after you login by going to the "Profile" section on your control panel!
  14. Your new password is: $NewPass
  15.  
  16. Regards,
  17. The Gta-Multi Team");
  18. mysql_query("UPDATE `Users` SET `Password` = '".RES(Encode($NewPass))."' WHERE `Users`.`CusID` =".RES($row['CusID']).";");
  19. mysql_query("DELETE FROM `ForgotSerial` WHERE `ForgotSerial`.`Serial` = '".RES($_POST['Code'])."'");
  20. }
  21. else $Des->Error("You have entered a wrong serial code!");
  22. }
  23. elseif(!empty($_POST['Username']) && !empty($_POST['Email']))
  24. {
  25. $result=mysql_query("SELECT `CusID` FROM `Users` WHERE `Username` = '".RES($_POST['Username'])."' AND `Email` = '".RES($_POST['Email'])."' LIMIT 1");
  26. if(mysql_num_rows($result))
  27. {
  28. $row=mysql_fetch_assoc($result);
  29. echo "We have send an E-mail to your E-mail address, please enter the serial-code provided in the E-mail to continue.";
  30. echo "<br/><br/>Code:<br/><form method=\"POST\"><input type=\"text\" style=\"width:300px;\" name=\"Code\">";
  31. echo "<br/><br/><input type=\"submit\" value=\"Continue\"></form><br/><br/>";
  32. $Serial=Encode(rand(1000000000000000000,9999999999999999999));
  33. mysql_query("INSERT INTO `ForgotSerial` (`CusID`, `Serial`, `Date`) VALUES ('".RES($row['CusID'])."', '".RES($Serial)."', CURRENT_TIMESTAMP);");
  34. $Mail->Send($row['CusID'],"Password Reset", "Hello %FULLNAME%,
  35.  
  36. There was a new password requested for this Gta-Multi account.
  37. Please enter the serial provided in this E-Mail into the Lost Password page.
  38.  
  39. Serial: $Serial
  40.  
  41. If you did not requested for a password reset, please ignore this e-mail.
  42.  
  43. Regards,
  44. The Gta-Multi Team");
  45. }
  46. else $Des->Error("You entered a wrong username/e-mail combination!");
  47. }
  48. else
  49. {
  50. echo "If you have forgot or lost your password to your Gta-Multi account, you can request a new one here. Please enter your username and E-Mail address to continue.<br/><br/>";
  51. echo "<form method=\"POST\">Username:<br/><input type=\"text\" name=\"Username\" style=\"width:200px;\"><br/>";
  52. echo "<br/>E-Mail:<br/><input type=\"text\" name=\"Email\" style=\"width:300px;\"><br/><br/>";
  53. echo "<input type=\"submit\" value=\"Continue\"></form><br/><br/>";
  54. }
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement