From: Michael M Slusarz Date: Tue, 25 Nov 2008 22:17:52 +0000 (-0700) Subject: More fixes re: the new MIMP code. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5908f5eb9e755d85557a389d243821dbd42de5ea;p=horde.git More fixes re: the new MIMP code. --- diff --git a/imp/lib/Mime/Viewer/itip.php b/imp/lib/Mime/Viewer/itip.php index 8b12f8ce1..278e0aec6 100644 --- a/imp/lib/Mime/Viewer/itip.php +++ b/imp/lib/Mime/Viewer/itip.php @@ -462,7 +462,7 @@ class IMP_Horde_Mime_Viewer_itip extends Horde_Mime_Viewer_Driver if ($this->viewAsAttachment()) { $html .= Util::bufferOutput('require', $registry->get('templates', 'horde') . '/common-header.inc'); } - if ($_SESSION['imp']['viewmode'] == 'imp') { + if ($_SESSION['imp']['view'] == 'imp') { $html .= '
'; } @@ -491,7 +491,7 @@ class IMP_Horde_Mime_Viewer_itip extends Horde_Mime_Viewer_Driver } // Need to work out if we are inline and actually need this. - if ($_SESSION['imp']['viewmode'] == 'imp') { + if ($_SESSION['imp']['view'] == 'imp') { $html .= '
'; } if ($this->viewAsAttachment()) { @@ -562,7 +562,7 @@ class IMP_Horde_Mime_Viewer_itip extends Horde_Mime_Viewer_Driver } } - if ($_SESSION['imp']['viewmode'] != 'imp') { + if ($_SESSION['imp']['view'] != 'imp') { return $html; } @@ -799,7 +799,7 @@ class IMP_Horde_Mime_Viewer_itip extends Horde_Mime_Viewer_Driver $html .= ''; } - if ($_SESSION['imp']['viewmode'] != 'imp') { + if ($_SESSION['imp']['view'] != 'imp') { return $html; } @@ -931,7 +931,7 @@ class IMP_Horde_Mime_Viewer_itip extends Horde_Mime_Viewer_Driver $html .= ''; } - if ($_SESSION['imp']['viewmode'] != 'imp') { + if ($_SESSION['imp']['view'] != 'imp') { return $html; } diff --git a/imp/lib/Mime/Viewer/pgp.php b/imp/lib/Mime/Viewer/pgp.php index 459c8a287..c832a7958 100644 --- a/imp/lib/Mime/Viewer/pgp.php +++ b/imp/lib/Mime/Viewer/pgp.php @@ -163,8 +163,7 @@ class IMP_Horde_Mime_Viewer_pgp extends Horde_Mime_Viewer_Driver /* Check if this a symmetrically encrypted message. */ $symmetric = $this->_imppgp->encryptedSymmetrically($encrypted_data); if ($symmetric && !$this->_imppgp->getSymmetricPassphrase()) { - if (isset($_SESSION['imp']['viewmode']) && - ($_SESSION['imp']['viewmode'] == 'imp')) { + if ($_SESSION['imp']['view'] == 'imp') { // TODO: Fix to work with DIMP /* Ask for the correct passphrase if this is encrypted * symmetrically. */ @@ -184,8 +183,7 @@ class IMP_Horde_Mime_Viewer_pgp extends Horde_Mime_Viewer_Driver $status[] = _("The message below has been encrypted with PGP, however, no personal private key exists so the message cannot be decrypted."); return null; } elseif (!$this->_imppgp->getPassphrase() && - ($_SESSION['imp']['viewmode']) && - ($_SESSION['imp']['viewmode'] == 'imp')) { + ($_SESSION['imp']['view'] == 'imp')) { // TODO: Fix to work with DIMP /* Ask for the private key's passphrase if this is encrypted * asymmetrically. */ @@ -310,8 +308,7 @@ class IMP_Horde_Mime_Viewer_pgp extends Horde_Mime_Viewer_Driver Text_Filter::filter($sig_result, 'text2html', array('parselevel' => TEXT_HTML_NOHTML)) ) ); - } elseif (isset($_SESSION['imp']['viewmode']) && - ($_SESSION['imp']['viewmode'] == 'imp')) { + } elseif ($_SESSION['imp']['view'] == 'imp') { // TODO: Fix to work with DIMP $status[] = Horde::link(Util::addParameter(Horde::selfUrl(true), array('pgp_verify_msg' => 1))) . _("Click HERE to verify the message.") . ''; } diff --git a/imp/lib/Mime/Viewer/smime.php b/imp/lib/Mime/Viewer/smime.php index 20571813e..72a98a453 100644 --- a/imp/lib/Mime/Viewer/smime.php +++ b/imp/lib/Mime/Viewer/smime.php @@ -115,7 +115,7 @@ class IMP_Horde_Mime_Viewer_smime extends Horde_Mime_Viewer_Driver 'status' => array( array( 'icon' => Horde::img('mime/encryption.png', 'S/MIME'), - 'text' => array() + 'text' => array(_("This message has been encrypted via S/MIME.")) ) ), 'type' => 'text/html; charset=' . NLS::getCharset() @@ -138,8 +138,7 @@ class IMP_Horde_Mime_Viewer_smime extends Horde_Mime_Viewer_Driver /* Make sure we have a passphrase. */ $passphrase = $this->_impsmime->getPassphrase(); if ($passphrase === false) { - if (isset($_SESSION['imp']['viewmode']) && - ($_SESSION['imp']['viewmode'] == 'imp')) { + if ($_SESSION['imp']['view'] == 'imp') { // TODO: Fix to work with DIMP $status[] = Horde::link('#', _("You must enter the passphrase for your S/MIME private key to view this message"), null, null, $this->_impsmime->getJSOpenWinCode('open_passphrase_dialog') . 'return false;') . _("You must enter the passphrase for your S/MIME private key to view this message.") . ''; } @@ -233,8 +232,7 @@ class IMP_Horde_Mime_Viewer_smime extends Horde_Mime_Viewer_Driver if ($GLOBALS['prefs']->getValue('smime_verify') || Util::getFormData('smime_verify_msg')) { $sig_result = $this->_impsmime->verifySignature($raw_text); - } elseif (isset($_SESSION['imp']['viewmode']) && - ($_SESSION['imp']['viewmode'] == 'imp')) { + } elseif ($_SESSION['imp']['view'] == 'imp') { // TODO: Fix to work with DIMP $status[] = Horde::link(Util::addParameter(Horde::selfUrl(true), 'smime_verify_msg', 1)) . _("Click HERE to verify the message.") . ''; return $ret; diff --git a/imp/lib/api.php b/imp/lib/api.php index a3292f983..51d45f4da 100644 --- a/imp/lib/api.php +++ b/imp/lib/api.php @@ -185,9 +185,10 @@ function _imp_compose($args = array(), $extra = array()) */ function _imp_batchCompose($args = array(), $extra = array()) { - if (isset($_SESSION['imp']['viewmode']) && - $_SESSION['imp']['viewmode'] != 'imp') { - return $GLOBALS['registry']->callByPackage($_SESSION['imp']['viewmode'], 'batchCompose', array($args, $extra)); + // TODO: Fix + if (isset($_SESSION['imp']['view']) && + $_SESSION['imp']['view'] != 'imp') { + return $GLOBALS['registry']->callByPackage($_SESSION['imp']['view'], 'batchCompose', array($args, $extra)); } $GLOBALS['authentication'] = 'none'; diff --git a/imp/lib/base.php b/imp/lib/base.php index b5632a5f5..7469bd2cc 100644 --- a/imp/lib/base.php +++ b/imp/lib/base.php @@ -10,6 +10,7 @@ * 'none' - Do not authenticate * Default - Authenticate to IMAP/POP server * $compose_page - If true, we are on IMP's compose page + * $login_page - If true, we are on IMP's login page * $mimp_debug - If true, output text/plain version of page. * $no_compress - Controls whether the page should be compressed * $session_control - Sets special session control limitations @@ -136,7 +137,8 @@ if ($authentication !== 'none') { // Notification system. $notification = &Notification::singleton(); -if ($_SESSION['imp']['view'] == 'mimp') { +if ((Util::nonInputVar('login_page') && $GLOBALS['browser']->isMobile()) || + (isset($_SESSION['imp']['view']) && ($_SESSION['imp']['view'] == 'mimp'))) { require_once 'Horde/Notification/Listener/mobile.php'; $GLOBALS['mimp_notify'] = &$notification->attach('status', null, 'Notification_Listener_mobile'); } else { @@ -165,7 +167,7 @@ if ((IMP::loginTasksFlag() === 2) && IMP_Session::loginTasks(); } -if ($_SESSION['imp']['view'] == 'mimp') { +if (isset($_SESSION['imp']['view']) && ($_SESSION['imp']['view'] == 'mimp')) { // Need to explicitly load MIMP.php require_once IMP_BASE . '/lib/MIMP.php'; diff --git a/imp/login.php b/imp/login.php index 99305fa17..9b828b054 100644 --- a/imp/login.php +++ b/imp/login.php @@ -13,6 +13,7 @@ @define('AUTH_HANDLER', true); $authentication = 'none'; +$login_page = true; require_once dirname(__FILE__) . '/lib/base.php'; /* Set the 'preferred' server. */ @@ -218,7 +219,6 @@ if (!empty($conf['user']['select_view'])) { /* Mobile login page. */ if ($browser->isMobile()) { require_once 'Horde/Mobile.php'; - require_once 'Horde/Notification/Listener/mobile.php'; /* Build the