Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- require_once('./inc/core.php');
- if(Login($_SESSION['username'], $_SESSION['password'], true)){
- header("LOCATION: ". PATH ."/me.php");
- exit;
- }
- if(isset($_POST['username']) && isset($_POST['password'])){
- $_SESSION['LOGIN_USERNAME'] = filter($_POST['username']);
- $_SESSION['LOGIN_PASSWORD'] = filter($_POST['password']);
- $username = filter($_POST['username']);
- $password = str_replace("\\'", "'", $_POST['password']);
- if(empty($username)){
- header("LOCATION: /goto?error");
- }
- elseif(empty($password)){
- header("LOCATION: /goto?error");
- }
- if(empty($username) || empty($password)){
- header("LOCATION: /goto?error");
- }
- elseif(CheckBanned($username, $remote_ip)){
- $error = CheckBanned($username, $remote_ip);
- }
- elseif(Login($username, $password)){
- $_SESSION['username'] = getuser($username, $password, "username");
- $_SESSION['password'] = HoloHash($password, $username);
- mysql_query("UPDATE users SET last_used = '". time() ."' WHERE username = '{$username}'");
- header("LOCATION: ". PATH ."/me.php");
- exit;
- }
- else{
- $error = "Tu contraseña y nombre de usuario no coinciden.";
- $_SESSION['LOGIN_ERROR'] = $error;
- header("LOCATION: /goto?error");
- exit;
- }
- }
- else{
- header("LOCATION: ". PATH ."/");
- exit;
- }
- ob_end_flush();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement