コード例 #1
0
ファイル: auth.php プロジェクト: BlocklandGlass/GlassWebsite
                    $blid = $_REQUEST['blid'];
                    $port = $_REQUEST['port'];
                    $ip = $_SERVER['REMOTE_ADDR'];
                    ServerTracker::updateRecord($ip, $port, $username, $clArray);
                }
            }
        }
    }
    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));
    $con->setServer($isServer);
    $blAuth = $con->attemptBlocklandAuth();
    if ($blAuth === true) {
        $ret->status = "success";
        $ret->ident = $con->getIdentifier();
        $con->setAuthed(true);
        if ($isServer) {
            $clients = stripcslashes($_REQUEST['clients']);
            $clArray = array();
            if ($clients != "") {
                $clDatArray = explode("\n", $clients);
                foreach ($clDatArray as $clDat) {
                    $dat = explode("\t", $clDat);
                    $obj = new stdClass();
                    $obj->name = $dat[0];
                    $obj->blid = intval($dat[1]);