Advertisement
encoree1996

Untitled

Aug 30th, 2015
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2.  
  3.     function user_not_valid()
  4.     {
  5.         die ('0');
  6.     }
  7.  
  8.     function user_valid()
  9.     {
  10.         die ('1');
  11.     }
  12.  
  13.     include 'connect_to_mysql.php';
  14.    
  15.     //GET_['a'] == login
  16.     //GET_['b'] == md5 hash of password
  17.     //GET_['c'] == md5 hash of hardware id
  18.     //GET_['d'] == md5 hash (login+passwordMD5+hwidMD5+'check_user');
  19.     if(isset($GET_['a']) && isset($GET_['b']) && isset($GET_['c']) && isset($GET_['d']))
  20.     {
  21.         $username = $GET_['a'];
  22.         $password_hash = $GET_['b'];
  23.         $hardwareID_hash = $GET_['c'];
  24.         $request_hash = $GET_['d'];
  25.         $username_length = strlen($username);
  26.  
  27.         if(strlen($password_hash) != 32 || strlen($hardwareID_hash) != 32 || strlen($request_hash) != 32)
  28.             user_not_valid();
  29.        
  30.         if($username_length < 1 || $username_length > 32)
  31.             user_not_valid();
  32.     }else{
  33.         user_not_valid();
  34.     }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement