public static function getUser() { global $params; self::echoJSON(Connect::getUser($params['id'])); }
<?php include 'dbConnection.php'; $conn = new Connect(); $user = $_POST['usuario']; $verifi = $_POST['verificacion']; $ver = $conn->getUser($verifi); if ($ver['rol'] == 1) { $conn->deleteUser($user); header("location: users.php?task=deletedSucessfully"); } else { header("location: form.php?error=NoPermision"); }
<?php include 'dbConnection.php'; if (isset($_POST['usuario']) && $_POST['usuario'] != null) { $usuario = $_POST['usuario']; } else { header("location: form.php?error=UserMissing"); exit; } if (isset($_POST['pass']) && $_POST['pass'] != null) { $password = $_POST['pass']; } else { header("location: form.php?error=PasswordMissing"); exit; } $conn = new Connect(); $user = $conn->getUser($usuario); if ($user['password'] == $password) { $_SESSION['usuario'] = $user['usuario']; header("location: index.php"); } else { header("location: form.php?error=WrongPassword"); exit; }