Index: trunk/core/units/general/inp_ses_storage.php =================================================================== diff -u -N -r2540 -r2596 --- trunk/core/units/general/inp_ses_storage.php (.../inp_ses_storage.php) (revision 2540) +++ trunk/core/units/general/inp_ses_storage.php (.../inp_ses_storage.php) (revision 2596) @@ -25,7 +25,7 @@ $this->SetMode( $mode ); $this->SetCookieDomain( SERVER_NAME ); parent::Init($prefix,$special); - + if (!defined('ADMIN')) { $group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup'); $this->SetField('GroupList', $group_list); @@ -45,47 +45,47 @@ $this->DataValueField = 'VariableValue'; $this->DataVarField = 'VariableName'; } - + function LocateSession($sid) { $query = ' SELECT '.$this->TimestampField.' FROM '.$this->TableName.' WHERE '.$this->IDField.' = '.$this->Conn->qstr($sid); $result = $this->Conn->GetOne($query); - + if($result===false) return false; - + $this->Expiration = $result + $this->SessionTimeout; return true; } - + function UpdateSession(&$session) { $query = ' UPDATE '.$this->TableName.' SET '.$this->TimestampField.' = unix_timestamp() WHERE '.$this->IDField.' = '.$this->Conn->qstr($session->SID); $this->Conn->Query($query); } - - + + function StoreSession(&$session) { parent::StoreSession($session); $this->SetField($session, 'IpAddress', $_SERVER['REMOTE_ADDR']); $this->SetField($session, 'GroupList', $this->Application->ConfigValue('User_GuestGroup')); } - + function GetExpiredSIDs() { $query = ' SELECT '.$this->IDField.' FROM '.$this->TableName.' WHERE '.time().' - '.$this->TimestampField.' > '.$this->SessionTimeout; $ret = $this->Conn->GetCol($query); if($ret) $this->DeleteEditTables(); return $ret; - + } - + function DeleteEditTables() { - $tables = $this->Conn->GetCol('SHOW TABLES'); + $tables = $this->Conn->GetCol('SHOW TABLES'); $mask_edit_table = '/'.TABLE_PREFIX.'ses_(.*)_edit_(.*)/'; $mask_search_table = '/'.TABLE_PREFIX.'ses_(.*)_(.*)/'; - + $sql='SELECT COUNT(*) FROM '.$this->TableName.' WHERE '.$this->IDField.' = \'%s\''; foreach($tables as $table) {