Advertisement
Guest User

Untitled

a guest
Oct 17th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 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. $database = new database($db_host, $db_name, $db_user, $db_password);
  18.  
  19. //query the databse for users details
  20. $query = $database->processQuery("SELECT password, acc_status FROM users WHERE username = LIMIT 1", array($_GET['username']), true);
  21.  
  22. //retrieve the players username and password from the database
  23. if (isset($_GET['username']) && isset($_GET['password'])) {
  24.  
  25.     $pass = hash(sha256, md5(sha1($_GET['username'])));
  26.     $user_password = substr(substr($query[0]['password'], 54), 0, -3);
  27.  
  28.     echo ($pass == $user_password) ? '0' : '1';
  29. } else {
  30.     echo '0';
  31. }
  32.  
  33. //check the users rank status
  34. // 1 - regular player, 2 - player mod, 3 - forum moderator, 4 - badministrator
  35. if (isset($_GET['username'])) {
  36.  
  37.     $rights_value = $query[0]['acc_status'];
  38.  
  39.     echo $rights_value;
  40. } else {
  41.     echo '0';
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement