connect()->prepare($sql); $stmt->execute([$userInfo[0]]); $row = $stmt->fetch(); if(isset($_POST['email'])) { if($row) { if($row['password'] == null) { if($row['googleID'] != null) echo "google user doesn't have password set up"; else if($row['facebookID'] != null) echo "facebook user doesn't have password set up"; else if($row['githubID'] != null) echo "github user doesn't have password set up"; } else echo 'user exists'; } else echo "user doesn't exist"; return; } } public function login($userInfo) { if(!filter_var($userInfo[0], FILTER_VALIDATE_EMAIL)) { echo 'error email'; return; } $sql = 'SELECT * FROM users WHERE email = ?'; $stmt = $this->connect()->prepare($sql); $stmt->execute([$userInfo[0]]); $row = $stmt->fetch(); if(password_verify($userInfo[1], $row['password'])) { include_once 'session.inc.php'; $session = new Session(); $session->setSession($userInfo[0]); echo 'success'; } else echo 'wrong password'; } public function pswSet() { if (session_status() == PHP_SESSION_NONE) session_start(); $string = ''; if($_SESSION['password-set'] != 'Not set') { $string = '