switch ($um->modifyAccount($_POST["oldPw"], "", $newPw, "")) { case 1: return $um->statusDump(500, "An error has occured (2)", null); break; } } return $um->statusDump(200, "Success", null); } else { return $um->statusDump(401, "User not authorized", null); } break; case "checkPassword": require_once "../framework/UserMgmt.php"; $um = new UserMgmt(); $password = filter_var($_POST["password"], FILTER_SANITIZE_STRING); if ($um->checkPassword($password)) { echo genJSON(200, "Password Correct", ""); } else { echo genJSON(406, "Password Incorrect", ""); } break; case "checkUsername": require_once "../framework/UserMgmt.php"; $um = new UserMgmt(); $username = filter_var($_POST["username"], FILTER_SANITIZE_STRING); if ($um->checkUsername($username)) { echo genJSON(200, "Username Available", ""); } else { echo genJSON(406, "Username Taken", ""); } break;