public static function tearDownAfterClass() { $user = new User(self::$pdo); foreach (self::$users as $key => $value) { $user->setEmail($value[0]); $result = $user->delete(); if (!$result) { throw new \Exception('Could not delete user : '******'"' . $value[1] . '"'); } } }
} if (isset($_SESSION['email']) & isset($_SESSION['pass'])) { if ($user->loginRequest($_SESSION['email'], $_SESSION['pass'])) { $image->findImageByUserID($user->getId()); echo $twig->render("click.twig", ['username' => $user->getUsername(), 'errors' => $errors, 'imageURL' => $image->getImageURL(), 'clickCount' => $user->getClickCount()]); exit; } } if (isset($_POST['email']) & isset($_POST['pass'])) { if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $gotEmail = $_POST['email']; $gotPass = $_POST['pass']; if ($user->loginRequest($gotEmail, $gotPass)) { $_SESSION['email'] = $gotEmail; $_SESSION['pass'] = $gotPass; $user->setEmail($gotEmail); $image->findImageByUserID($user->getId()); echo $twig->render("click.twig", ['username' => $user->getUsername(), 'errors' => $errors, 'imageURL' => $image->getImageURL(), 'clickCount' => $user->getClickCount()]); exit; } else { $errors[] = "Email and password don't match"; echo $twig->render("form.twig", ['errors' => $errors, 'message' => $message]); exit; } } else { $errors[] = "Invalid email"; } } echo $twig->render("form.twig", ['errors' => $errors, 'message' => $message]); /* SCRAPYARD