Index: branches/unlabeled/unlabeled-1.57.2/core/kernel/session/session.php =================================================================== diff -u -r8232 -r8233 --- branches/unlabeled/unlabeled-1.57.2/core/kernel/session/session.php (.../session.php) (revision 8232) +++ branches/unlabeled/unlabeled-1.57.2/core/kernel/session/session.php (.../session.php) (revision 8233) @@ -256,7 +256,7 @@ function LoadPersistentVars(&$session) { - $user_id = $this->Application->RecallVar('user_id'); + $user_id = $session->RecallVar('user_id'); if ($user_id != -2) { // root & normal users $sql = 'SELECT VariableValue, VariableName @@ -271,9 +271,13 @@ function StorePersistentVar(&$session, $var_name, $var_value) { + $user_id = $session->RecallVar('user_id'); + if ($user_id == -2) { + return ; + } + $this->PersistentVars[$var_name] = $var_value; - - $user_id = $this->Application->RecallVar('user_id'); + $key_clause = 'PortalUserId = '.$user_id.' AND VariableName = '.$this->Conn->qstr($var_name); $sql = 'SELECT VariableValue @@ -304,7 +308,7 @@ { unset($this->PersistentVars[$var_name]); - $user_id = $this->Application->RecallVar('user_id'); + $user_id = $session->RecallVar('user_id'); if ($user_id != -2) { $sql = 'DELETE FROM '.TABLE_PREFIX.'PersistantSessionData @@ -798,14 +802,23 @@ $last_template = basename($_SERVER['PHP_SELF']).'|'.substr($last_env, strlen(ENV_VAR_NAME) + 1); $this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template); - if (!$wid && $this->Application->IsAdmin() && $this->Application->LoggedIn() && ($t <> 'login')) { - // only for main window, not popups, not login template (used in adm:MainFrameLink tag) - $this->StorePersistentVar('last_template_popup', $last_template); - } - // save other last... variables for mistical purposes (customizations may be) $this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink $this->StoreVar('last_env', substr($last_env, strlen(ENV_VAR_NAME)+1)); + + // save last_template in persistant session + if (!$wid && ($t != 'login')) { + if ($this->Application->IsAdmin()) { + // only for main window, not popups, not login template (used in adm:MainFrameLink tag) + $this->StorePersistentVar('last_template_popup', $last_template); + } + elseif ($this->Application->GetVar('admin') == 1) { + $admin_session =& $this->Application->recallObject('Session.admin'); + /* @var $admin_ses Session */ + + $admin_session->StorePersistentVar('last_template_popup', '../'.$last_template); + } + } } function getLastTemplateENV($t, $params)