From 3aa46abc5d81b5bc2f82919e43321ca8588eab24 Mon Sep 17 00:00:00 2001 From: stevetruckstuff Date: Thu, 17 Aug 2006 20:54:46 +0000 Subject: [PATCH] Fix incorrect template assignment. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11609 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- include/init.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/include/init.php b/include/init.php index 9610e493..0e00ac24 100644 --- a/include/init.php +++ b/include/init.php @@ -407,7 +407,6 @@ switch ($sInitLocation) { */ require(SM_PATH . 'include/load_prefs.php'); - // i do not understand the frames language cookie story /** * We'll need this to later have a noframes version @@ -491,17 +490,23 @@ switch ($sInitLocation) { * Initialize the template object */ require(SM_PATH . 'class/template/template.class.php'); + /* * $sTplDir is not initialized when a user is not logged in, so we will use * the config file defaults here. If the neccesary variables are net set, * force a default value. + * + * If the user is logged in, $sTplDir will be set in load_prefs.php, so we + * shouldn't change it here. */ -$aTemplateSet = ( !isset($aTemplateSet) ? array() : $aTemplateSet ); -$templateset_default = ( !isset($templateset_default) ? 0 : $templateset_default ); - -$sTplDir = ( !isset($aTemplateSet[$templateset_default]['PATH']) ? - SM_PATH . 'templates/default/' : - $aTemplateSet[$templateset_default]['PATH'] ); +if (!isset($sTplDir)) { + $aTemplateSet = ( !isset($aTemplateSet) ? array() : $aTemplateSet ); + $templateset_default = ( !isset($templateset_default) ? 0 : $templateset_default ); + + $sTplDir = ( !isset($aTemplateSet[$templateset_default]['PATH']) ? + SM_PATH . 'templates/default/' : + $aTemplateSet[$templateset_default]['PATH'] ); +} $oTemplate = new Template($sTplDir); /** -- 2.25.1