} } } echo json_encode($ret, JSON_PRETTY_PRINT); } else { $ret = new stdClass(); $username = $_REQUEST['username']; $blid = $_REQUEST['blid']; $ip = $_SERVER['REMOTE_ADDR']; $con = new ClientConnection(array($blid, $username, $ip)); $blAuth = $con->attemptBlocklandAuth(); if ($blAuth === true) { $ret->status = "success"; $ret->ident = $con->getIdentifier(); $con->setAuthed(true); if ($con->hasGlassAccount()) { $ret->debug = "glass account found"; } else { $userArray = $con->getUnverifiedAccounts(); if (sizeof($userArray) > 0) { $ret->action = "verify"; $verifyData = array(); foreach ($userArray as $user) { $verifyData[] = $user->getEmail(); } $ret->verify_data = $verifyData; } } } else { $ret->status = "failed"; $ret->msg = $blAuth[0];