Index: branches/unlabeled/unlabeled-1.56.2/core/kernel/utility/http_query.php =================================================================== diff -u -r8180 -r8233 --- branches/unlabeled/unlabeled-1.56.2/core/kernel/utility/http_query.php (.../http_query.php) (revision 8180) +++ branches/unlabeled/unlabeled-1.56.2/core/kernel/utility/http_query.php (.../http_query.php) (revision 8233) @@ -360,12 +360,18 @@ // env=SID:TEMPLATE:m-1-1-1-1:l0-0-0:n-0-0-0:bb-0-0-1-1-1-0 $vars = Array (); if ($env_var) { + $more_vars = strpos($env_var, '&'); + if ($more_vars !== false) { + parse_str(substr($env_var, $more_vars + 1), $vars); + $env_var = substr($env_var, 0, $more_vars); + } + // replace escaped ":" symbol not to explode by it $env_var = str_replace('\:','_&+$$+&_', $env_var); // replace escaped "=" with spec-chars :) $parts = explode(':', $env_var); if (!$this->Application->RewriteURLs() || ($this->Application->RewriteURLs() && $this->Get('rewrite') != 'on')) { - $vars = $this->extractSIDAndTemplate($parts); + $vars = array_merge_recursive2($vars, $this->extractSIDAndTemplate($parts)); } if ($parts) { Index: branches/unlabeled/unlabeled-1.178.2/core/kernel/application.php =================================================================== diff -u -r8217 -r8233 --- branches/unlabeled/unlabeled-1.178.2/core/kernel/application.php (.../application.php) (revision 8217) +++ branches/unlabeled/unlabeled-1.178.2/core/kernel/application.php (.../application.php) (revision 8233) @@ -2245,7 +2245,8 @@ */ function LoggedIn() { - return $this->Session->LoggedIn(); + // no session during expiration process + return is_null($this->Session) ? false : $this->Session->LoggedIn(); } /** Index: branches/unlabeled/unlabeled-1.36.2/core/units/admin/admin_tag_processor.php =================================================================== diff -u -r8232 -r8233 --- branches/unlabeled/unlabeled-1.36.2/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 8232) +++ branches/unlabeled/unlabeled-1.36.2/core/units/admin/admin_tag_processor.php (.../admin_tag_processor.php) (revision 8233) @@ -730,18 +730,26 @@ return false; } - list(, $env) = explode('|', $last_template); + list($index_file, $env) = explode('|', $last_template); $vars = $this->Application->HttpQuery->processQueryString($env, 'pass'); - if ($vars['t'] == 'login' || $vars['t'] == 'index') { + $recursion_templates = Array ('login', 'index'); + + if (isset($vars['admin']) && $vars['admin'] == 1) { + // index template doesn't begin recursion on front-end (in admin frame) + $vars['m_theme'] = ''; + unset($recursion_templates[ array_search('index', $recursion_templates)]); + } + + if (in_array($vars['t'], $recursion_templates)) { // prevents redirect recursion OR old in-portal pages return false; } $vars = array_merge_recursive2($vars, $params); $t = $vars['t']; unset($vars['t']); - - return $this->Application->HREF($t, '', $vars); + + return $this->Application->HREF($t, '', $vars, $index_file); } 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) Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/login.tpl =================================================================== diff -u -r8202 -r8233 --- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/login.tpl (.../login.tpl) (revision 8202) +++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/login.tpl (.../login.tpl) (revision 8233) @@ -1,4 +1,5 @@ +