Index: branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php =================================================================== diff -u -r6849 -r6852 --- branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php (.../session.php) (revision 6849) +++ branches/unlabeled/unlabeled-1.52.4/core/kernel/session/session.php (.../session.php) (revision 6852) @@ -67,7 +67,7 @@ var $ChangedDirectVars = Array(); var $PersistentVars = Array (); - + var $OriginalData=Array(); var $TimestampField; @@ -93,13 +93,13 @@ function StoreSession(&$session, $additional_fields = Array()) { - $fields_hash = Array ( + $fields_hash = Array ( $this->IDField => $session->SID, $this->TimestampField => $session->Expiration ); - - $this->Conn->doInsert($fields_hash, $this->TableName); + $this->Conn->doInsert($fields_hash, $this->TableName); + foreach ($additional_fields as $field_name => $field_value) { $this->SetField($session, $field_name, $field_value); } @@ -250,10 +250,10 @@ } return $expired_sids; } - + function LoadPersistentVars(&$session) { - $user_id = $this->Application->GetVar('u_id'); + $user_id = $this->Application->RecallVar('user_id'); if ($user_id != -2) { // root & normal users $sql = 'SELECT VariableValue, VariableName @@ -265,31 +265,31 @@ $this->PersistentVars = Array (); } } - + function StorePersistentVar(&$session, $var_name, $var_value) { $this->PersistentVars[$var_name] = $var_value; - - $replace_hash = Array ( - 'PortalUserId' => $this->Application->GetVar('u_id'), + + $replace_hash = Array ( + 'PortalUserId' => $this->Application->RecallVar('user_id'), 'VariableName' => $var_name, 'VariableValue' => $var_value ); $this->Conn->doInsert($replace_hash, TABLE_PREFIX.'PersistantSessionData', 'REPLACE'); - + } - + function RecallPersistentVar(&$session, $var_name, $default = false) { return isset($this->PersistentVars[$var_name]) ? $this->PersistentVars[$var_name] : $default; } - + function RemovePersistentVar(&$session, $var_name) { unset($this->PersistentVars[$var_name]); - - $user_id = $this->Application->GetVar('u_id'); - + + $user_id = $this->Application->RecallVar('user_id'); + if ($user_id != -2) { $sql = 'DELETE FROM '.TABLE_PREFIX.'PersistantSessionData WHERE PortalUserId = '.$user_id.' AND VariableName = '.$this->Conn->qstr($var_name); @@ -656,7 +656,7 @@ { return isset($this->Application->HttpQuery->Cookie[$this->CookieName]) ? $this->Application->HttpQuery->Cookie[$this->CookieName] : false; } - + /** * Updates SID in cookie with new value * @@ -724,7 +724,7 @@ function PrintSession($comment='') { if($this->Application->isDebugMode() && constOn('DBG_SHOW_SESSIONDATA')) { - // dump session data + // dump session data $this->Application->Debugger->appendHTML('SessionStorage ('.$comment.'):'); $session_data = $this->Data->GetParams(); ksort($session_data); @@ -747,7 +747,7 @@ } $this->Application->Debugger->dumpVars($session_data); } - + // to insert after HTTPQuery if it's visible // $new_row = constOn('DBG_SHOW_HTTPQUERY') ? 4 : 2; // $debugger->moveAfterRow($new_row,2); @@ -778,17 +778,17 @@ { $this->Data->Set($name, $value); } - + function StorePersistentVar($name, $value) { $this->Storage->StorePersistentVar($this, $name, $value); } - + function LoadPersistentVars() { $this->Storage->LoadPersistentVars($this); } - + function StoreVarDefault($name, $value) { $tmp = $this->RecallVar($name); @@ -808,7 +808,7 @@ { return $this->Storage->RecallPersistentVar($this, $name, $default); } - + function RemoveVar($name) { $this->Storage->RemoveFromData($this, $name); @@ -819,7 +819,7 @@ { return $this->Storage->RemovePersistentVar($this, $name); } - + /** * Ignores session varible value set before *