| 1 | <?PHP |
| 2 | include_once('../slack.php'); |
| 3 | include_once('/var/www/secure.php'); |
| 4 | include_once('../email.php'); |
| 5 | if(isset($_POST['email'])){ |
| 6 | $email = $_POST['email']; |
| 7 | $r = $petition->query("SELECT * FROM users WHERE email = '$email'"); |
| 8 | $row = mysqli_fetch_array($r,MYSQLI_ASSOC); |
| 9 | if ($row['email'] != ''){ |
| 10 | $pass = rand(1000,9999); |
| 11 | $salt = md5(rand(1000,9999)); |
| 12 | $hash = md5($pass.$salt); |
| 13 | $encrypted = $hash.':'.$salt; |
| 14 | //off_world_mail(,,); |
| 15 | $subject = 'MD Petition Login'; |
| 16 | $body = 'Login with '.$email.' and your new password '.$pass.' at https://www.md-petition.com/admin/login.php'; |
| 17 | meps_mail($email,$body,$subject); |
| 18 | $petition->query("update users set pass = '$encrypted' WHERE email = '$email'"); |
| 19 | echo "<h1>Your Password has been Sent.</h1>"; |
| 20 | slack_general_admin('DEBUG: '.$body,'md-petition-signed'); |
| 21 | }else{ |
| 22 | echo "<h1>E-Mail address not found.</h1>"; |
| 23 | slack_general('ADMIN: Reset- E-Mail address not found','md-petition'); |
| 24 | } |
| 25 | }else{ |
| 26 | slack_general('ADMIN: reset.php','md-petition'); |
| 27 | } |
| 28 | ?> |
| 29 | <script async src="https://www.googletagmanager.com/gtag/js?id=G-TY6C66ZWMX"></script> |
| 30 | <script> |
| 31 | window.dataLayer = window.dataLayer || []; |
| 32 | function gtag(){dataLayer.push(arguments);} |
| 33 | gtag('js', new Date()); |
| 34 | |
| 35 | gtag('config', 'G-TY6C66ZWMX'); |
| 36 | </script> |
| 37 | <form action="reset.php" method="post" accept-charset="utf-8"> <table> |
| 38 | <tbody><tr> |
| 39 | <td>E-Mail Address</td> |
| 40 | <td><input type="text" name="email" value=""></td> |
| 41 | </tr> |
| 42 | <tr> |
| 43 | <td> </td> |
| 44 | <td><input type="submit" name="resetGo" value="Reset Password"> or <a href='login.php'>Login Here</a></td> |
| 45 | </tr> |
| 46 | </tbody></table> |
| 47 | </form> |