From ef33def68208a5b7050aaa0ac61399d4d19de6e6 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Wed, 29 Aug 2007 07:24:27 +0000 Subject: [PATCH] Make sure to use correct template set after login git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12624 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/init.php | 14 +++++++------- src/redirect.php | 8 +++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/init.php b/include/init.php index 26e43e4e..880cbc4a 100644 --- a/include/init.php +++ b/include/init.php @@ -250,6 +250,13 @@ if (PAGE_NAME == 'login') { sqsession_is_active(); session_regenerate_id(); + + // put session restore data back into session if necessary + if (!empty($sel)) { + sqsession_register($sel, 'session_expired_location'); + if (!empty($sep)) + sqsession_register($sep, 'session_expired_post'); + } } /** @@ -383,13 +390,6 @@ switch (PAGE_NAME) { require(SM_PATH . 'functions/page_header.php'); require(SM_PATH . 'functions/html.php'); - // put session restore data back into session if necessary - if (!empty($sel)) { - sqsession_register($sel, 'session_expired_location'); - if (!empty($sep)) - sqsession_register($sep, 'session_expired_post'); - } - // reset template file cache // $sTemplateID = Template::get_default_template_set(); diff --git a/src/redirect.php b/src/redirect.php index aa5c4239..354cbc9f 100644 --- a/src/redirect.php +++ b/src/redirect.php @@ -136,6 +136,11 @@ if ( sqgetGlobalVar('HTTP_ACCEPT', $http_accept, SQ_SERVER) && attachment_common_parse($http_accept); } +// having just logged in, need to synch the template file cache +// so the right template set is displayed (per user prefs) +require(SM_PATH . 'include/load_prefs.php'); +Template::cache_template_file_hierarchy(TRUE); + /* Complete autodetection of Javascript. */ checkForJavascript(); @@ -153,7 +158,8 @@ if ( sqgetGlobalVar('session_expired_location', $session_expired_location, SQ_SE } else { $redirect_url = $location . '/webmail.php?right_frame=' . urlencode($session_expired_location . '.php'); } - } else if ($session_expired_location != 'webmail') { + } else if ($session_expired_location != 'webmail' + && $session_expired_location != 'left_main') { $redirect_url = $location . '/webmail.php?right_frame=' . urlencode($session_expired_location . '.php'); } unset($session_expired_location); -- 2.25.1