$pref = isset($_POST["pref"]) ? htmlspecialchars($_POST["pref"], FILTER_SANITIZE_NUMBER_INT) : null; echo $um->setEmailPref($pref); break; case "getEmailPref": require_once "../framework/UserMgmt.php"; $um = new UserMgmt(); echo $um->getEmailPref(); break; case "login": require_once "../framework/UserMgmt.php"; $um = new UserMgmt(); if (isset($_POST["email"], $_POST["password"])) { $email = filter_var($_POST["email"], FILTER_SANITIZE_EMAIL); $password = filter_var($_POST["password"], FILTER_SANITIZE_STRING); $rememberMe = isset($_POST["rememberMe"]) && $_POST["rememberMe"] == "true" ? true : false; $r = $um->login($email, $password, $rememberMe); switch ($r) { case 0: echo "success"; break; case 1: echo "Username or password incorrect."; break; case 2: echo "verify"; break; case 5: echo "Your account has been banned for foul language. We warned you!"; break; case 450: echo "reset";