Advertisement
Guest User

Untitled

a guest
Oct 17th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: x_stormrider
  5.  * Date: 10/18/2016
  6.  * Time: 12:07 AM
  7.  *
  8.  * A skeleton module used to integrate the ScapeRune website with the official server
  9.  *
  10.  */
  11.  
  12. //imperative for connection to the database
  13. require('structure/database.php');
  14. require('includes/config.php');
  15.  
  16. //declare basic vars
  17. //gets the users actual username
  18. $username = $user->getUsername($_COOKIE['user'], 2);
  19.  
  20. //get the users actual rank
  21. $rank = $user->getRank($username);
  22.  
  23. //get general database information
  24. $database = new database($db_host, $db_name, $db_user, $db_password);
  25.  
  26. //query the databse for users details
  27. $query = $database->processQuery("SELECT password, acc_status FROM users WHERE username = LIMIT 1", array($_GET['username']), true);
  28.  
  29. //retrieve the players username and password from the database
  30. if (isset($_GET['username']) && isset($_GET['pass'])) {
  31.  
  32.     $password = hash(sha256, md5(sha1($_GET['pass'])));
  33.     $user_password = substr(substr($query[0]['password'], 54), 0, -3);
  34.  
  35.     echo ($pass == $user_password) ? '0' : '1';
  36. } else {
  37.     echo '0';
  38. }
  39.  
  40. //check the users rank status
  41. // 1 - regular player, 2 - player mod, 3 - forum moderator, 4 - administrator
  42. if (isset($_GET['username'])) {
  43.  
  44.     $rights_value = $rank;
  45.  
  46.     echo $rights_value;
  47. } else {
  48.     echo '0';
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement