Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.58 KB | None | 0 0
  1. <?
  2. require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
  3. require_once(INCL_DIR.'user_functions.php');
  4. require_once(INCL_DIR.'password_functions.php');
  5. dbconn();
  6. loggedinorreturn();
  7.  
  8. $HTMLOUT . '';
  9.  
  10. // Reset Lost Password ACTION
  11. if ($CURUSER['class'] < UC_ADMINISTRATOR)
  12.     stderr("Error", "Permission denied Your Not A Admin+.");
  13.  
  14. if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
  15. {
  16.   $username = trim($_POST["username"]);
  17.     $res = mysql_query("SELECT * FROM users WHERE username=" . sqlesc($username) . " ") or sqlerr();
  18.  $arr = mysql_fetch_assoc($res);
  19.  
  20.  
  21.  $id = $arr['id'];
  22. $newpass="digifeed";
  23. $secret = mksecret();
  24. $newpassword =  make_passhash( $secret, md5($newpass) ) ;
  25. mysql_query('UPDATE users SET passhash=' . sqlesc($newpassword) . ' WHERE id = ' . sqlesc($id) . ' AND editsecret = ' . sqlesc($fetch["editsecret"]));
  26. write_log("Password Reset For $username by $CURUSER[username]");
  27.   if (!mysql_affected_rows())
  28.     stderr("Error", "Unable to RESET PASSWORD on this account.");
  29.   else
  30.     stderr("Success", "The account <b>$username</b> Password Reset To resetthisnow please inform User of this change.");
  31.  
  32. }
  33. stdhead("Reset User's Lost Password");
  34. $HTMLOUT .="
  35. <h1>Reset User's Lost Password</h1>
  36. <form method='post' action='resetpassword.php' >
  37. <table border='0' cellspacing='0' cellpadding='5'>
  38. <tr><td><input size='40' name='username' value='Username here' />&nbsp;&nbsp;<input type='submit' class='btn' value='resetthisnow' /></td></tr>
  39. </table></form>";
  40.  
  41. print stdhead('Reset Lost Password'). $HTMLOUT . stdfoot();
  42. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement