Index: branches/RC/kernel/include/usersession.php =================================================================== diff -u -N -r10438 -r10607 --- branches/RC/kernel/include/usersession.php (.../usersession.php) (revision 10438) +++ branches/RC/kernel/include/usersession.php (.../usersession.php) (revision 10607) @@ -129,7 +129,7 @@ $this->Set("GroupList",$this->Get("GroupList")); $this->Set("Language", (int)$this->Get("Language")); $this->Set("tz",$this->Get("tz")); - $this->Set("LastAccessed",adodb_date("U") + $objConfig->Get("SessionTimeout")); + $this->Set("LastAccessed",adodb_date("U")); $this->Update(); } } @@ -262,7 +262,7 @@ { global $objConfig; - $this->Set("LastAccessed", adodb_mktime() + $objConfig->Get("SessionTimeout")); + $this->Set('LastAccessed', adodb_mktime() + $objConfig->Get('SessionTimeout')); if(!is_numeric($this->Get("PortalUserId"))) { $this->Set("PortalUserId",0); @@ -758,7 +758,7 @@ { global $objConfig; - $cutoff = adodb_mktime(); //-$objConfig->Get("SessionTimeout"); + $cutoff = adodb_mktime(); $thiskey = $this->GetSessionKey(); $sql = "SELECT SessionKey from ".GetTablePrefix()."UserSession WHERE LastAccessed<$cutoff AND SessionKey != '$thiskey'"; $result = $this->adodbConnection->Execute($sql); @@ -1179,28 +1179,16 @@ //$this->Update(); } - function ValidSession($SessionKey=NULL) + function ValidSession($SessionKey = NULL) { - global $objConfig; - - $a = $this->Get("LastAccessed"); - $cutoff = adodb_mktime()-$objConfig->Get("SessionTimeout"); - //echo $a." ".$cutoff."
"; - //$ip = ($_SERVER['REMOTE_ADDR'] == $this->Get("IpAddress")); - //echo $this->Get("IpAddress"); - //$ip = TRUE; - if ($a < $cutoff) { - //$this->UpdateAccessTime(); - } - return ($a >= $cutoff); - - + return $this->Get('LastAccessed') > adodb_mktime(); } function UpdateAccessTime() { global $objConfig; - $this->Set("LastAccessed", adodb_mktime() + $objConfig->Get("SessionTimeout")); + + $this->Set('LastAccessed', adodb_mktime() + $objConfig->Get('SessionTimeout')); } function InSpamControl($ResourceId,$DataType=NULL)