Make sure to use correct template set after login
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 29 Aug 2007 07:24:27 +0000 (07:24 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 29 Aug 2007 07:24:27 +0000 (07:24 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12624 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/init.php
src/redirect.php

index 26e43e4..880cbc4 100644 (file)
@@ -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();
index aa5c423..354cbc9 100644 (file)
@@ -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);