Advertisement
Guest User

Untitled

a guest
Jan 14th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php
  2. define('IN_MYBB', false);
  3. require_once './global.php';
  4.  
  5.  
  6.  
  7. if($_POST["apikey"] == "YOURAPIKEYHERE")
  8. {
  9. if($_GET["action"] == "login")
  10. {
  11. $query = $db->query("SELECT * FROM " . TABLE_PREFIX . " WHERE username='".$db->escape_string($_POST['username'])."'");
  12. if($query->num_rows == 0)
  13. {
  14. echo "USER_NOTFOUND";
  15. } else {
  16. while($result = $db->fetch_array($query))
  17. {
  18. $end_password = $result['password'];
  19.  
  20. if(md5(md5($result['salt']).md5($_POST["password"])) == $end_password)
  21. {
  22. echo "OK_LOGINSUCCESS";
  23. } else {
  24. echo "FAIL_WRONGLOGINDATA";
  25. }
  26. }
  27. }
  28. }
  29. } else {
  30. die("Access denied.");
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement