Reduce confusion about what user is running the web server
[squirrelmail.git] / src / redirect.php
index 4c910bcb34928544f8532b01da74516145328f27..ff00fbdd9da80952ae6a8de5ae943a764ff06d3d 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Derived from webmail.php by Ralf Kraudelt <kraude@wiwi.uni-rostock.de>
  *
- * @copyright &copy; 1999-2007 The SquirrelMail Project Team
+ * @copyright &copy; 1999-2009 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -136,6 +136,12 @@ 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');
+global $sTemplateID;
+Template::cache_template_file_hierarchy($sTemplateID, TRUE);
+
 /* Complete autodetection of Javascript. */
 checkForJavascript();
 
@@ -153,7 +159,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 {
+    } 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);