Advertisement
Guest User

Untitled

a guest
Apr 7th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2. /**
  3.  * FILE DESCRIPTION: a class handling the integration of ScapeRune
  4.  *
  5.  * @Author: x_stormrider
  6.  * @Date: 4/7/2017
  7.  * @Time: 8:27 PM
  8.  */
  9.  
  10. if (isset($_GET['name']) && isset($_GET['pass'])) {
  11.     require('../includes/config.php');
  12.     require('../structure/database.php');
  13.  
  14.     $database = new database($db_host, $db_name, $db_user, $db_password);
  15.     $data = $database->processQuery("SELECT password FROM users WHERE username = ? LIMIT 1", array($_GET['name']), true);
  16.  
  17.     $password = hash(sha256, md5(sha1($_GET['pass'])));
  18.     $db_password = substr(substr($data[0]['password'], 54), 0, -3);
  19.  
  20.     echo ($password == $db_password) ? '1' : '0';
  21. } else {
  22.     echo '0';
  23. }
  24.  
  25. if (isset($_GET['name'])) {
  26.     require('../includes/config.php');
  27.     require('../structure/database.php');
  28.  
  29.     $database = new database($db_host, $db_name, $db_user, $db_password);
  30.     $data = $database->processQuery("SELECT acc_status FROM users WHERE username = ? LIMIT 1", array($_GET['name']), true);
  31.  
  32.     $status = $data[0]['acc_status'];
  33.  
  34.     echo $status;
  35. } else {
  36.     echo '0';
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement