Browse Source

Make sure to use correct template set after login

pdontthink 18 years ago
parent
commit
b80d382d2a
2 changed files with 14 additions and 8 deletions
  1. 7 7
      include/init.php
  2. 7 1
      src/redirect.php

+ 7 - 7
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();

+ 7 - 1
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);