Index: branches/RC/core/units/users/users_event_handler.php =================================================================== diff -u -r11702 -r11865 --- branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 11702) +++ branches/RC/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 11865) @@ -132,25 +132,42 @@ return parent::CheckPermission($event); } - function OnSessionExpire() + /** + * Handles session expiration (redirects to valid template) + * + * @param kEvent $event + */ + function OnSessionExpire(&$event) { $this->Application->resetCounters('UserSession'); + // place 2 of 2 (also in kHTTPQuery::getRedirectParams) + $admin_url_params = Array ( + 'm_cat_id' => 0, // category means nothing on admin login screen + 'm_wid' => '', // remove wid, otherwise parent window may add wid to its name breaking all the frameset (for targets) + 'pass' => 'm', // don't pass any other (except "m") prefixes to admin session expiration template + 'expired' => 1, // expiration mark to show special error on login screen + 'no_pass_through' => 1, // this way kApplication::HREF won't add them again + ); + if ($this->Application->IsAdmin()) { - $this->Application->Redirect('index', Array('expired' => 1), '', 'index.php'); + + $this->Application->Redirect('index', $admin_url_params, '', 'index.php'); } if ($this->Application->GetVar('admin') == 1) { + // Front-End showed in admin's right frame $session_admin =& $this->Application->recallObject('Session.admin'); /* @var $session_admin Session */ if (!$session_admin->LoggedIn()) { // front-end session created from admin session & both expired $this->Application->DeleteVar('admin'); - $this->Application->Redirect('index', Array('expired' => 1), '', 'admin/index.php'); + $this->Application->Redirect('index', $admin_url_params, '', 'admin/index.php'); } } + // Front-End session expiration $get = $this->Application->HttpQuery->getRedirectParams(); $t = $this->Application->GetVar('t'); $get['js_redirect'] = $this->Application->ConfigValue('UseJSRedirect');