Ejemplo n.º 1
0
function isSessionIDValid($config, $xsid)
{
    $bValid = false;
    //Instantiate the CR3DCQuery Class
    $oR3DCQuery = new CR3DCQuery($config);
    //$oR3DCQuery->CheckSIDTimeout();
    CSession::initialise($config);
    CSession::CheckSIDTimeout();
    if ($xsid != "") {
        //if($oR3DCQuery->CheckLogin($config, $xsid))
        if (CSession::CheckLogin($xsid)) {
            $session = base64_decode($xsid);
            // list($uniq, $player_id) = preg_split("/\|/", $session);
            list($uniq, $player_id) = explode("|", $session);
            if ($uniq != "" && is_numeric($player_id)) {
                $bValid = true;
                //$oR3DCQuery->UpdateSIDTimeout($config, $xsid);
                CSession::UpdateSIDTimeout($xsid);
                $oR3DCQuery->SetPlayerCreditsInit($player_id);
            }
        }
    }
    if ($oR3DCQuery->ELOIsActive()) {
        $oR3DCQuery->ELOCreateRatings();
    }
    $oR3DCQuery->MangeGameTimeOuts();
    $oR3DCQuery->Close();
    unset($oR3DCQuery);
    return $bValid;
}
Ejemplo n.º 2
0
    header('Location: ./chess_login.php');
} else {
    $oR3DCQuery->CheckSIDTimeout();
    if ($oR3DCQuery->CheckLogin($config, $_SESSION['sid']) == false) {
        $_SESSION['PageRef'] = $url;
        header('Location: ./chess_login.php');
    } else {
        $_SESSION['PageRef'] = "";
        $oR3DCQuery->UpdateSIDTimeout($ConfigFile, $_SESSION['sid']);
        $oR3DCQuery->SetPlayerCreditsInit($_SESSION['id']);
    }
    if (!$bCronEnabled) {
        if ($oR3DCQuery->ELOIsActive()) {
            $oR3DCQuery->ELOCreateRatings();
        }
        $oR3DCQuery->MangeGameTimeOuts();
    }
}
///////////////////////////////////////////////////////////////////////
?>

<html>
<head>
<title><?php 
echo GetStringFromStringTable("IDS_PAGETITLES_19", $config);
?>
</title>

<META NAME="keywords" CONTENT="">
<META NAME="DESCRIPTION" CONTENT="">
<META NAME="OWNER" CONTENT="Christian">