2 include_once('../slack.php');
3 include_once('/var/www/secure.php');
4 include('offWorldMail.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($email,$row['name'],'Login with '.$email.' and your new password '.$pass.' at http://md-petition.com/admin/login.php');
15 $petition->query("update users set pass = '$encrypted' WHERE email = '$email'");
16 echo "<h1>Your Password has been Sent.</h1>";
17 slack_general('ADMIN: Reset- Your Password has been Sent','md-petition');
19 echo "<h1>E-Mail address not found.</h1>";
20 slack_general('ADMIN: Reset- E-Mail address not found','md-petition');
23 slack_general('ADMIN: reset.php','md-petition');
27 <form action
="reset.php" method
="post" accept
-charset
="utf-8"> <table
>
29 <td
>E
-Mail Address
</td
>
30 <td
><input type
="text" name
="email" value
=""></td
>
34 <td
><input type
="submit" name
="resetGo" value
="Reset Password"> or <a href
='login.php'>Login Here
</a
></td
>