Index: trunk/kernel/include/usersession.php =================================================================== diff -u -r1237 -r1376 --- trunk/kernel/include/usersession.php (.../usersession.php) (revision 1237) +++ trunk/kernel/include/usersession.php (.../usersession.php) (revision 1376) @@ -630,7 +630,9 @@ if(!is_object($this->CurrentUser)) $this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId")); if(!$this->CurrentUser->VarsLoaded) + { $this->CurrentUser->LoadPersistantVars(); + } } if((int)$this->GetPersistantVariable("Language")) $this->Set("Language",$objConfig->Get("Language")); Index: trunk/kernel/include/portaluser.php =================================================================== diff -u -r1345 -r1376 --- trunk/kernel/include/portaluser.php (.../portaluser.php) (revision 1345) +++ trunk/kernel/include/portaluser.php (.../portaluser.php) (revision 1376) @@ -18,8 +18,8 @@ $this->id_field = "PortalUserId"; $this->TagPrefix="user"; - $this->Vars = array(); - $VarsLoaded = FALSE; + $this->Vars = Array(); + $this->VarsLoaded = FALSE; $this->debuglevel = 0; if(isset($UserId)) $this->LoadFromDatabase($UserId); @@ -187,9 +187,10 @@ global $objConfig; unset($this->Vars); - $this->Vars = array(); + $this->Vars = Array(); $user_id = $this->HasField('PortalUserId') ? $this->Get('PortalUserId') : 0; - $sql = "SELECT VariableName, VariableValue FROM ".GetTablePrefix()."PersistantSessionData WHERE PortalUserId = 0 OR PortalUserId = ".$user_id." ORDER BY PortalUserId ASC"; + + $sql = "SELECT VariableName, VariableValue FROM ".GetTablePrefix()."PersistantSessionData WHERE PortalUserId = ".(int)$user_id." ORDER BY PortalUserId ASC"; $result = $this->adodbConnection->Execute($sql); while ($result && !$result->EOF) { @@ -198,7 +199,7 @@ $objConfig->Set($data["VariableName"], $data["VariableValue"], 1, 1); $result->MoveNext(); } - $this->VarsLoaded=TRUE; + $this->VarsLoaded = TRUE; } function SetPersistantVariable($variableName, $variableValue) @@ -235,7 +236,9 @@ global $objConfig, $objSession; if(!$this->VarsLoaded) + { $this->LoadPersistantVars(); + } $fields = array_keys($this->Vars); @@ -261,8 +264,9 @@ function GetAllPersistantVars() { if(!$this->VarsLoaded) + { $this->LoadPersistantVars(); - + } return $this->Vars; }