From cce64dc0372140209e6ada122c9f68d89cefa2b9 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 6 Jul 2009 15:24:59 -0600 Subject: [PATCH] Moved gnupg, openssl, and spellchecking config to Horde --- imp/config/conf.xml | 40 +--------------------------------------- imp/config/prefs.php.dist | 4 ++-- imp/docs/INSTALL | 15 ++------------- imp/docs/UPGRADING | 2 +- imp/lib/Compose.php | 2 +- imp/lib/Crypt/Pgp.php | 12 +++++++----- imp/lib/Crypt/Smime.php | 11 +++++++---- imp/lib/IMP.php | 2 +- imp/lib/Mime/Viewer/Pgp.php | 6 +++--- imp/lib/Mime/Viewer/Plain.php | 4 ++-- 10 files changed, 27 insertions(+), 71 deletions(-) diff --git a/imp/config/conf.xml b/imp/config/conf.xml index d90087548..101d886d2 100644 --- a/imp/config/conf.xml +++ b/imp/config/conf.xml @@ -1,45 +1,7 @@ - - - Spell Checker - - - - - - - - - - - External Utilities - - pgp.mit.edu - - pgp.mit.edu - keyserver.noreply.org - - - 10 - - - - + Menu settings _("PGP Options"), @@ -189,7 +189,7 @@ if (isset($GLOBALS['conf']['utils']['gnupg'])) { ); } -if (Horde_Util::extensionExists('openssl') && isset($GLOBALS['conf']['utils']['openssl_binary'])) { +if (Horde_Util::extensionExists('openssl') && isset($GLOBALS['conf']['openssl']['path'])) { $prefGroups['smime'] = array( 'column' => _("Other Options"), 'label' => _("S/MIME Options"), diff --git a/imp/docs/INSTALL b/imp/docs/INSTALL index 39466e281..59035c834 100644 --- a/imp/docs/INSTALL +++ b/imp/docs/INSTALL @@ -233,18 +233,7 @@ The following items are not required, but are strongly **RECOMMENDED**: You must use the 2.x branch of Gollem with IMP 5.x. -6. aspell - Spelling Checker - - Aspell, a comand-line program, is used as IMP's spell-checking engine. - You must install and configure aspell to use IMP's spell-check feature. - - Version 0.60 or higher is REQUIRED. - - You can obtain aspell from: - - http://aspell.sourceforge.net/ - -7. A web server with PATH_INFO support. +6. A web server with PATH_INFO support. IMP requires the PATH_INFO environment variable for several features. Every modern web server supports this, but you might have to enable this feature @@ -256,7 +245,7 @@ The following items are not required, but are strongly **RECOMMENDED**: create the information using other server variables, but this process is slower and less reliable. -8. A configured VFS backend. +7. A configured VFS backend. During composition of messages, it is possible that the PHP session may timeout. If VFS is enabled in Horde, IMP can store the draft message and diff --git a/imp/docs/UPGRADING b/imp/docs/UPGRADING index cfdca24a0..fc722722a 100644 --- a/imp/docs/UPGRADING +++ b/imp/docs/UPGRADING @@ -30,7 +30,7 @@ supported. * old attachment icon handling see atc_flag pref * imp_hook_msglist_flags hook now used to dynamically set flags on messages * maintenance tasks -* tos_agreement (moved to Horde) +* tos_agreement, gnupg, openssl, spellchecking (moved to Horde) diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 36ace86f1..9defa6065 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -1041,7 +1041,7 @@ class IMP_Compose /* Set up the base message now. */ $encrypt = empty($options['encrypt']) ? 0 : $options['encrypt']; if ($GLOBALS['prefs']->getValue('use_pgp') && - !empty($GLOBALS['conf']['utils']['gnupg']) && + !empty($GLOBALS['conf']['gnupg']['path']) && in_array($encrypt, array(IMP::PGP_ENCRYPT, IMP::PGP_SIGN, IMP::PGP_SIGNENC, IMP::PGP_SYM_ENCRYPT, IMP::PGP_SYM_SIGNENC))) { $imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); diff --git a/imp/lib/Crypt/Pgp.php b/imp/lib/Crypt/Pgp.php index 1184e3f2e..b079d820d 100644 --- a/imp/lib/Crypt/Pgp.php +++ b/imp/lib/Crypt/Pgp.php @@ -22,7 +22,7 @@ class IMP_Crypt_Pgp extends Horde_Crypt_Pgp public function __construct() { parent::__construct(array( - 'program' => $GLOBALS['conf']['utils']['gnupg'], + 'program' => $GLOBALS['conf']['gnupg']['path'], 'temp' => Horde::getTempDir() )); } @@ -308,17 +308,19 @@ class IMP_Crypt_Pgp extends Horde_Crypt_Pgp { global $conf; - if (empty($conf['utils']['gnupg_keyserver'])) { + if (empty($conf['gnupg']['keyserver'])) { throw new Horde_Exception(_("Public PGP keyserver support has been disabled.")); } - $timeout = (empty($conf['utils']['gnupg_timeout'])) ? PGP_KEYSERVER_TIMEOUT : $conf['utils']['gnupg_timeout']; + $timeout = empty($conf['gnupg']['timeout']) + ? Horde_Crypt_Pgp::KEYSERVER_TIMEOUT + : $conf['gnupg']['timeout']; if ($method == 'put') { - return $this->putPublicKeyserver($data, $conf['utils']['gnupg_keyserver'][0], $timeout); + return $this->putPublicKeyserver($data, $conf['gnupg']['keyserver'][0], $timeout); } - foreach ($conf['utils']['gnupg_keyserver'] as $server) { + foreach ($conf['gnupg']['keyserver'] as $server) { try { return $this->getPublicKeyserver($data, $server, $timeout, $additional); } catch (Horde_Exception $e) {} diff --git a/imp/lib/Crypt/Smime.php b/imp/lib/Crypt/Smime.php index 790178756..bb0214b9e 100644 --- a/imp/lib/Crypt/Smime.php +++ b/imp/lib/Crypt/Smime.php @@ -248,7 +248,7 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime */ public function verifySignature($text) { - return $this->verify($text, empty($GLOBALS['conf']['utils']['openssl_cafile']) ? array() : $GLOBALS['conf']['utils']['openssl_cafile']); + return $this->verify($text, empty($GLOBALS['conf']['openssl']['cafile']) ? array() : $GLOBALS['conf']['openssl']['cafile']); } @@ -396,7 +396,10 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime */ public function addFromPKCS12($pkcs12, $password, $pkpass = null) { - $sslpath = (empty($GLOBALS['conf']['utils']['openssl_binary'])) ? null : $GLOBALS['conf']['utils']['openssl_binary']; + $sslpath = empty($GLOBALS['conf']['openssl']['path']) + ? null + : $GLOBALS['conf']['openssl']['path']; + $params = array('sslpath' => $sslpath, 'password' => $password); if (!empty($pkpass)) { $params['newpassword'] = $pkpass; @@ -418,9 +421,9 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime */ public function extractSignedContents($data) { - $sslpath = empty($GLOBALS['conf']['utils']['openssl_binary']) + $sslpath = empty($GLOBALS['conf']['openssl']['path']) ? null - : $GLOBALS['conf']['utils']['openssl_binary']; + : $GLOBALS['conf']['openssl']['path']; return parent::extractSignedContents($data, $sslpath); } diff --git a/imp/lib/IMP.php b/imp/lib/IMP.php index 0247127b1..4fb67bb87 100644 --- a/imp/lib/IMP.php +++ b/imp/lib/IMP.php @@ -1000,7 +1000,7 @@ class IMP $enc_opts = array(self::ENCRYPT_NONE => _("No Encryption")); $output = ''; - if (!empty($GLOBALS['conf']['utils']['gnupg']) && + if (!empty($GLOBALS['conf']['gnupg']['path']) && $GLOBALS['prefs']->getValue('use_pgp')) { $enc_opts += array( self::PGP_ENCRYPT => _("PGP Encrypt Message"), diff --git a/imp/lib/Mime/Viewer/Pgp.php b/imp/lib/Mime/Viewer/Pgp.php index 986c72286..df92b1ca2 100644 --- a/imp/lib/Mime/Viewer/Pgp.php +++ b/imp/lib/Mime/Viewer/Pgp.php @@ -64,7 +64,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver protected function _renderInline() { if (empty($this->_imppgp) && - !empty($GLOBALS['conf']['utils']['gnupg'])) { + !empty($GLOBALS['conf']['gnupg']['path'])) { $this->_imppgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); } @@ -139,7 +139,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver $status = &self::$_inlinecache[$base_id][$base_id]['status'][0]['text']; /* Is PGP active? */ - if (empty($GLOBALS['conf']['utils']['gnupg']) || + if (empty($GLOBALS['conf']['gnupg']['path']) || !$GLOBALS['prefs']->getValue('use_pgp')) { $status[] = _("The message below has been encrypted via PGP, however, PGP support is disabled so the message cannot be decrypted."); return null; @@ -326,7 +326,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver $status = &$ret[$base_id]['status'][0]['text']; if (!$GLOBALS['prefs']->getValue('use_pgp') || - empty($GLOBALS['conf']['utils']['gnupg'])) { + empty($GLOBALS['conf']['gnupg']['path'])) { /* If PGP not active, hide signature data and output status * information. */ $status[] = _("The message below has been digitally signed via PGP, but the signature cannot be verified."); diff --git a/imp/lib/Mime/Viewer/Plain.php b/imp/lib/Mime/Viewer/Plain.php index 25f9757f3..dea3a61d2 100644 --- a/imp/lib/Mime/Viewer/Plain.php +++ b/imp/lib/Mime/Viewer/Plain.php @@ -129,7 +129,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain */ public function embeddedMimeParts() { - return (!empty($GLOBALS['conf']['utils']['gnupg']) && $GLOBALS['prefs']->getValue('pgp_scan_body')) || $this->getConfigParam('uudecode'); + return (!empty($GLOBALS['conf']['gnupg']['path']) && $GLOBALS['prefs']->getValue('pgp_scan_body')) || $this->getConfigParam('uudecode'); } /** @@ -144,7 +144,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain { $ret = null; - if (!empty($GLOBALS['conf']['utils']['gnupg']) && + if (!empty($GLOBALS['conf']['gnupg']['path']) && $GLOBALS['prefs']->getValue('pgp_scan_body')) { $ret = $this->_parsePGP(); } -- 2.11.0