예제 #1
0
 static function initThisObject($parent, $class, $name = null)
 {
     if ($name) {
         $ssession = new Ssession($parent->__masterserver, $parent->__readserver, $name);
     } else {
         $ssession = new Ssession($parent->__masterserver, $parent->__readserver, $parent->__session_id);
     }
     $ssession->get();
     return $ssession;
 }
예제 #2
0
파일: lxlib.php 프로젝트: zseand/kloxo
function initSession($object, $ssl_param, $consuming_parent)
{
    global $gbl, $sgbl, $login, $ghtml;
    $progname = $sgbl->__var_program_name;
    $session = randomString(50);
    //clear_all_cookie();
    // Making cookie persistent, otherwise IE will not pass it to new windows. Needed in the file selector. Set the expiration to 10 years in the future. Needed for brain damaged ie, which cannot recognize server time.
    $cookietime = time() + 24 * 60 * 60 * 365 * 80;
    //$cookietime = 0;
    header('P3P: CP="CAO PSA OUR"');
    $ckstart = $progname;
    if ($consuming_parent) {
        $ckstart .= "-consumed";
    }
    if ($object->isAuxiliary()) {
        $name = $object->__auxiliary_object->nname;
        $class = $object->__auxiliary_object->getClass();
    } else {
        $name = $object->nname;
        $class = $object->getClass();
    }
    setcookie("{$ckstart}-clientname", $name, $cookietime, '/');
    setcookie("{$ckstart}-classname", $class, $cookietime, '/');
    setcookie("{$ckstart}-session-id", $session, $cookietime, '/');
    dprint("Set cookies<br/>");
    $hostname = $_SERVER['REMOTE_ADDR'];
    $sessobj = new Ssession(null, null, $session);
    $sessa['nname'] = $session;
    $sessa['ip_address'] = $_SERVER['REMOTE_ADDR'];
    $sessa['cttype'] = $object->getLoginType();
    $sessa['hostname'] = $hostname;
    $sessa['tsessionid'] = randomString(30);
    // Login time is set to null. This is set to the correct time inside display.php. This allows us to figure out the first run of display.php.
    $sessa['logintime'] = time();
    $sessa['ssession_vars'] = array();
    $sessa['http_vars'] = array();
    $sessa['parent_clname'] = $object->getClName();
    $sessa['consuming_parent'] = $consuming_parent;
    $sessa['auxiliary_id'] = $object->getAuxiliaryId();
    $sessa['ssl_param'] = $ssl_param;
    if (intval($object->getSpecialObject('sp_specialplay')->ssession_timeout) <= 100) {
        $timeout = 100;
    } else {
        $timeout = $object->getSpecialObject('sp_specialplay')->ssession_timeout;
    }
    $sessa['timeout'] = time() + $timeout;
    $sessa['last_access'] = time();
    $sessobj->create($sessa);
    return $sessobj;
}