public function verificaLogin($email, $password) { $vai = new MySQLDB(); $email = stripslashes($email); $password = stripslashes($password); $email = mysql_real_escape_string($email); $password = mysql_real_escape_string($password); $sql = "SELECT `senha` FROM `cliente` WHERE `email`='{$email}' AND `ativo`=1;"; $result = $vai->ExecuteQuery($sql); while ($rows = mysql_fetch_object($result)) { $pass = $rows->senha; } if ($pass == "") { header("Location: login.php?vi=erro_login"); } else { include "../../plugins/Password/PASSWORD.php"; $senha = PASSWORD::check_password($pass, $password); if ($senha) { $sql = "SELECT * FROM `cliente` WHERE `email`='{$email}';"; $result = $vai->ExecuteQuery($sql); while ($rows = mysql_fetch_object($result)) { $idcliente = $rows->idcliente; $email = $rows->email; $nome = $rows->nome; $folder = $rows->folder; } session_start(); $_SESSION['IdCliente'] = $idcliente; $_SESSION['EmailCliente'] = "{$email}"; $_SESSION['NomeCliente'] = "{$nome}"; $_SESSION['FolderCliente'] = "{$folder}"; $ip = $_SERVER["REMOTE_ADDR"]; $result = $vai->ExecuteQuery($sql2); header("Location: index.php"); } else { header("Location: login.php?vi=erro_login"); } } }
public function verificaLogin($email, $password) { $vai = new MySQLDB(); $email = stripslashes($email); $password = stripslashes($password); $email = mysql_real_escape_string($email); $password = mysql_real_escape_string($password); $sql = "SELECT `senha` FROM `aluno` WHERE `email`='{$email}';"; $result = $vai->ExecuteQuery($sql); while ($rows = mysql_fetch_object($result)) { $pass = $rows->senha; } if ($pass == "") { header("Location: login.php?vi=erro_login"); } else { include "../../plugins/Password/PASSWORD.php"; $senha = PASSWORD::check_password($pass, $password); if ($senha) { $sql = "SELECT `aluno`.`idaluno`, `aluno`.`email`, `aluno`.`nome`, `aluno`.`cpf`, `aluno`.`cliente_idcliente` FROM `aluno` WHERE `email`='{$email}';"; $result = $vai->ExecuteQuery($sql); while ($rows = mysql_fetch_object($result)) { $cliente = $rows->cliente_idcliente; $id = $rows->idaluno; $email = $rows->email; $nome = $rows->nome; $cpf = $rows->cpf; } session_start(); $_SESSION['idAluno'] = $id; $_SESSION['clienteAluno'] = $cliente; $_SESSION['emailAluno'] = "{$email}"; $_SESSION['nomeAluno'] = "{$nome}"; include "../../plugins/CreateVTT/CreateVTT.php"; $vtt = new CreateVTT(); $vtt->write($nome, $cpf, $email); header("Location: index.php"); } else { header("Location: login.php?vi=erro_login"); } } }