Index: trunk/kernel/include/usersession.php
===================================================================
diff -u -r168 -r228
--- trunk/kernel/include/usersession.php (.../usersession.php) (revision 168)
+++ trunk/kernel/include/usersession.php (.../usersession.php) (revision 228)
@@ -487,15 +487,15 @@
}
else
$sql = "INSERT INTO ".GetTablePrefix()."SessionData (VariableName,VariableValue,SessionKey) VALUES ('$variableName','$variableValue','$sessionkey')";
-
+
$this->adodbConnection->Execute($sql);
// echo "
UPDATE: $sql
";
//}
}
function SetPersistantVariable($variableName, $variableValue)
{
- global $objConfig;
+ global $objConfig, $objUsers;
$userid = (int)$this->Get("PortalUserId");
@@ -505,8 +505,9 @@
$this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId"));
if(!$this->CurrentUser->VarsLoaded)
$this->CurrentUser->LoadPersistantVars();
-
- $this->CurrentUser->SetPersistantVariable($variableName, $variableValue);
+ //echo "setting current user' $variableName, $variableValue
";
+ $this->CurrentUser->SetPersistantVariable($variableName, $variableValue);
+ //$this->SetVariable($variableName,$variableValue);
}
else
$this->SetVariable($variableName,$variableValue);
@@ -542,11 +543,6 @@
if(is_numeric($this->Get("PortalUserId")))
{
- if(!is_object($this->CurrentUser))
- $this->CurrentUser = $objUsers->GetItem($this->Get("PortalUserId"));
- if(!$this->CurrentUser->VarsLoaded)
- $this->CurrentUser->LoadPersistantVars();
-
$sql = "SELECT VariableName, VariableValue FROM ".GetTablePrefix()."SessionData where SessionKey='" . $this->Get("SessionKey") . "'";
//echo $sql."
\n";
$result = $this->adodbConnection->Execute($sql);
@@ -557,6 +553,11 @@
$objConfig->Set($data["VariableName"],$data["VariableValue"],FALSE);
$result->MoveNext();
}
+
+ 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"));