Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("includes/intranet.php");
- $intranet = new intranet();
- $data = array();
- //Check if Debug Mode or FORCE AJAX is on
- if($intranet->debugMode() === false || $intranet->loginForceAjax() === true){
- //check if data is sent via ajax
- if($intranet->checkAJAX() === false){
- //If it is not an ajax request
- $data['success'] = false;
- $data['msg'] = "Sorry an unknown error has occurred!";
- die(json_encode($data));
- }
- }
- //Import the sent data
- $username = $_POST['guGIgyygYIU'];
- $password = $_POST['UIJLGKIuvfu'];
- //Decrypt the data
- $username = base64_decode($username);
- $password = base64_decode($password);
- //Clean the data
- $username = $intranet->cleanInput($username);
- $password = $intranet->cleanInput($password);
- $query = mysql_query("SELECT `Password`,`Password_hash` FROM `users` WHERE `Username` = '$username' AND `Assword` = '$password'");
- //Check if username and password is valid
- if(mysql_num_rows($query) != '1'){
- //if it is not an ajax request
- $data['success'] = false;
- $data['msg'] = "Username/password is not valid";
- die(json_encode($data));
- }
- $a = mysql_fetch_assoc($query);
- $password_hash = $a['password_hash'];
- $password = $a['password'];
- //Make the cookie Yum :)
- //Generate a seed
- $seed = $intranet->generateSeed();
- $cookie_array = array();
- //Crypt the password
- $password = $intranet->
- ?>
Add Comment
Please, Sign In to add comment