Index: branches/RC/kernel/include/usersession.php =================================================================== diff -u -N -r8929 -r10438 --- branches/RC/kernel/include/usersession.php (.../usersession.php) (revision 8929) +++ branches/RC/kernel/include/usersession.php (.../usersession.php) (revision 10438) @@ -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")); + $this->Set("LastAccessed",adodb_date("U") + $objConfig->Get("SessionTimeout")); $this->Update(); } } @@ -262,7 +262,7 @@ { global $objConfig; - $this->Set("LastAccessed", adodb_mktime()); + $this->Set("LastAccessed", adodb_mktime() + $objConfig->Get("SessionTimeout")); if(!is_numeric($this->Get("PortalUserId"))) { $this->Set("PortalUserId",0); @@ -512,21 +512,21 @@ $this->SetVariable('UserGroups', $extra_groups); $this->SetVariable('user_id', $this->Get('PortalUserId')); - + $this->Set('GroupId', $PersonalGroup ? $PersonalGroup : $PrimaryGroup); $this->Set('GroupList', $extra_groups); $this->SetVariable('UserGroups', $this->Get('GroupList') ); - + $app = kApplication::Instance(); $kSession = $app->recallObject('Session'); $kSession->SetField('GroupList', $extra_groups); $app->StoreVar('UserGroups', $this->Get('GroupList') ); $app->setVisitField('PortalUserId', $this->Get('PortalUserId') ); - - $this->Set('LastAccessed', adodb_date('U') ); + + $this->Set('LastAccessed', adodb_date('U') + $objConfig->Get("SessionTimeout")); $this_login = $this->GetPersistantVariable("ThisLogin"); $this->SetPersistantVariable("LastLogin", $this_login); $this->SetPersistantVariable("ThisLogin", adodb_mktime()); @@ -591,7 +591,7 @@ trigger_error('Attempt to set session variable without name', E_USER_WARNING); return ; } - + $objConfig->Set($variableName,$variableValue,2); $variableValue = addslashes($variableValue); @@ -658,7 +658,7 @@ if (!strlen($val)) { $val = $objConfig->Get($variableName); } - + return $val; } @@ -758,7 +758,7 @@ { global $objConfig; - $cutoff = adodb_mktime()-$objConfig->Get("SessionTimeout"); + $cutoff = adodb_mktime(); //-$objConfig->Get("SessionTimeout"); $thiskey = $this->GetSessionKey(); $sql = "SELECT SessionKey from ".GetTablePrefix()."UserSession WHERE LastAccessed<$cutoff AND SessionKey != '$thiskey'"; $result = $this->adodbConnection->Execute($sql); @@ -789,16 +789,16 @@ $sql = 'SELECT * FROM '.GetTablePrefix().'Permissions WHERE Type = 1 AND GroupId IN ('.$GroupList.')'; // AND PermissionValue = 1'; - + $rs = $this->adodbConnection->Execute($sql); - + $PermList = Array(); while ($rs && !$rs->EOF) { $this->SysPermCache[ $rs->fields['Permission'] ] = $rs->fields['PermissionValue']; $PermList[] = $rs->fields['Permission']; $rs->MoveNext(); } - + if ($PermList) { $this->SetVariable('SysPerm', implode(',', $PermList)); } @@ -854,19 +854,19 @@ if ($this->Get('PortalUserId') == -1 && ($PermissionName == 'ADMIN' || $PermissionName == 'LOGIN') ) { return true; } - + // cut last comma (just in case in-portal made a mistake before) $GroupList = $this->Get('GroupList'); if (substr($GroupList, -1) == ',') { $GroupList = substr($GroupList, 0, -1); $this->Set('GroupList', $GroupList); } - + // if loaded permissions are from other group list, then current (e.g. user is become logged-in during script run) if ($this->Get('GroupList') != $this->PermCacheGroups) { $this->ResetSysPermCache(); } - + // load system permission cache if not already loaded if (!$this->SysPermCacheLoaded()) { $this->GetSysPermCache(); @@ -1199,7 +1199,8 @@ function UpdateAccessTime() { - $this->Set("LastAccessed", adodb_mktime() ); + global $objConfig; + $this->Set("LastAccessed", adodb_mktime() + $objConfig->Get("SessionTimeout")); } function InSpamControl($ResourceId,$DataType=NULL)