From: Michael M Slusarz Date: Tue, 16 Dec 2008 20:04:06 +0000 (-0700) Subject: Reintroduce default charset feature. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=dc71f9c35115066aee8c5c9c4018439df83e06a4;p=horde.git Reintroduce default charset feature. --- diff --git a/imp/lib/base.php b/imp/lib/base.php index 0373aec38..e05888863 100644 --- a/imp/lib/base.php +++ b/imp/lib/base.php @@ -152,6 +152,24 @@ if ($authentication !== 'none') { } else { IMP::checkAuthentication(false, ($authentication === 'horde')); } + + /* Some stuff that only needs to be initialized if we are + * authenticated. */ + // Initialize some message parsing variables. + if (!empty($GLOBALS['conf']['mailformat']['brokenrfc2231'])) { + Horde_Mime::$brokenRFC2231 = true; + } + + // Set default message character set, if necessary + if ($def_charset = $prefs->getValue('default_msg_charset')) { + Horde_Mime_Part::$defaultCharset = $def_charset; + Horde_Mime_Headers::$defaultCharset = $def_charset; + } +} + +// Handle logout requests +if (($viewmode == 'dimp') && Util::nonInputVar('dimp_logout')) { + Horde::redirect(str_replace('&', '&', IMP::getLogoutUrl())); } // Notification system. @@ -170,9 +188,10 @@ if (($viewmode == 'mimp') || $notification->attach('audio'); } -// Handle logout requests -if (($viewmode == 'dimp') && Util::nonInputVar('dimp_logout')) { - Horde::redirect(str_replace('&', '&', IMP::getLogoutUrl())); +if ((IMP::loginTasksFlag() === 2) && + !defined('AUTH_HANDLER') && + !strstr($_SERVER['PHP_SELF'], 'maintenance.php')) { + IMP_Session::loginTasks(); } // Initialize global $imp_mbox array. @@ -183,12 +202,6 @@ $GLOBALS['imp_search'] = (isset($_SESSION['imp']) && strpos($GLOBALS['imp_mbox'] ? new IMP_Search(array('id' => $GLOBALS['imp_mbox']['mailbox'])) : new IMP_Search(); -if ((IMP::loginTasksFlag() === 2) && - !defined('AUTH_HANDLER') && - !strstr($_SERVER['PHP_SELF'], 'maintenance.php')) { - IMP_Session::loginTasks(); -} - if ($viewmode == 'mimp') { // Need to explicitly load MIMP.php require_once IMP_BASE . '/lib/MIMP.php'; @@ -201,8 +214,3 @@ if ($viewmode == 'mimp') { // Need to explicitly load DIMP.php require_once IMP_BASE . '/lib/DIMP.php'; } - -// TODO - Move somewhere else? -if (!empty($GLOBALS['conf']['mailformat']['brokenrfc2231'])) { - Horde_Mime::$brokenRFC2231 = true; -}