Guest User

Untitled

a guest
Aug 18th, 2018
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.37 KB | None | 0 0
  1. <?php
  2. include("includes/intranet.php");
  3. $intranet = new intranet();
  4.  
  5. $data = array();
  6. //Check if Debug Mode or FORCE AJAX is on
  7. if($intranet->debugMode() === false || $intranet->loginForceAjax() === true){
  8.     //check if data is sent via ajax
  9.     if($intranet->checkAJAX() === false){
  10.         //If it is not an ajax request
  11.         $data['success'] = false;
  12.         $data['msg'] = "Sorry an unknown error has occurred!";
  13.         die(json_encode($data));
  14.     }
  15. }
  16.  
  17. //Import the sent data
  18.  $username = $_POST['guGIgyygYIU'];
  19.  $password = $_POST['UIJLGKIuvfu'];
  20.  
  21.  //Decrypt the data
  22.  $username = base64_decode($username);
  23.  $password = base64_decode($password);
  24.  
  25.  //Clean the data
  26.  $username = $intranet->cleanInput($username);
  27.  $password = $intranet->cleanInput($password);
  28.  
  29.  
  30.  $query = mysql_query("SELECT `Password`,`Password_hash` FROM `users` WHERE `Username` = '$username' AND `Assword` = '$password'");
  31.  
  32.  //Check if username and password is valid
  33.  if(mysql_num_rows($query) != '1'){
  34.     //if it is not an ajax request
  35.     $data['success'] = false;
  36.     $data['msg'] = "Username/password is not valid";
  37.     die(json_encode($data));
  38.  }
  39.  $a = mysql_fetch_assoc($query);
  40.  $password_hash = $a['password_hash'];
  41.  $password = $a['password'];
  42.  
  43.  //Make the cookie Yum :)
  44.  //Generate a seed
  45.  $seed = $intranet->generateSeed();
  46.  $cookie_array = array();
  47.  
  48.  //Crypt the password
  49. $password = $intranet->
  50.  
  51. ?>
Add Comment
Please, Sign In to add comment