Moved gnupg, openssl, and spellchecking config to Horde
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Jul 2009 21:24:59 +0000 (15:24 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Jul 2009 21:24:59 +0000 (15:24 -0600)
imp/config/conf.xml
imp/config/prefs.php.dist
imp/docs/INSTALL
imp/docs/UPGRADING
imp/lib/Compose.php
imp/lib/Crypt/Pgp.php
imp/lib/Crypt/Smime.php
imp/lib/IMP.php
imp/lib/Mime/Viewer/Pgp.php
imp/lib/Mime/Viewer/Plain.php

index d900875..101d886 100644 (file)
@@ -1,45 +1,7 @@
 <?xml version="1.0"?>
 <!-- $Id$ -->
 <configuration>
- <configtab name="utils" desc="External Utilities and Menu">
-  <configsection name="spell">
-   <configheader>Spell Checker</configheader>
-   <configswitch name="driver" required="false" desc="Choose a Spell Checking backend">
-    <case name="" desc="None" />
-    <case name="aspell" desc="aspell (command line)">
-     <configsection name="params">
-      <configstring name="path" required="false" desc="Enter the location of
-      the aspell binary" />
-     </configsection>
-    </case>
-   </configswitch>
-  </configsection>
-  <configsection name="utils">
-   <configheader>External Utilities</configheader>
-   <configstring name="gnupg" required="false" desc="If you want users to have
-   the option of using the GNU Privacy Guard program to decrypt/encrypt PGP
-   files, enter the location of the 'gpg' binary here.  If this is empty this
-   feature will be disabled."/>
-   <configmultienum name="gnupg_keyserver" required="false" desc="The address
-   of the public PGP keyserver(s) to use.">pgp.mit.edu
-    <values>
-     <value>pgp.mit.edu</value>
-     <value>keyserver.noreply.org</value>
-    </values>
-   </configmultienum>
-   <configinteger name="gnupg_timeout" required="false" desc="The timeout for
-   connecting to the PGP keyserver. Timeouts are not supported on all
-   systems.">10</configinteger>
-   <configstring name="openssl_cafile" required="false" desc="The location of
-   the root certificates bundle, e.g. /etc/ssl/certs. See
-   http://www.php.net/manual/en/ref.openssl.php#openssl.cert.verification for
-   details."/>
-   <configstring name="openssl_binary" required="false" desc="The location of
-   the OpenSSL binary on your system, e.g. /usr/bin/openssl. This program is
-   REQUIRED to import personal S/MIME certificate information, as there is no
-   native PHP function that can read pkcs12 files."/>
-  </configsection>
-
+ <configtab name="menu" desc="Menu">
   <configsection name="menu">
    <configheader>Menu settings</configheader>
    <configmultienum name="apps" desc="Select any applications that should be
index 18a93ca..aa9100c 100644 (file)
@@ -180,7 +180,7 @@ $prefGroups['events'] = array(
     'members' => array('conflict_interval')
 );
 
-if (isset($GLOBALS['conf']['utils']['gnupg'])) {
+if (isset($GLOBALS['conf']['gnupg']['path'])) {
     $prefGroups['pgp'] = array(
         'column' => _("Other Options"),
         'label' => _("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"),
index 39466e2..59035c8 100644 (file)
@@ -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
index cfdca24..fc72272 100644 (file)
@@ -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)
 
 
 
index 36ace86..9defa60 100644 (file)
@@ -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'));
 
index 1184e3f..b079d82 100644 (file)
@@ -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) {}
index 7901787..bb0214b 100644 (file)
@@ -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);
     }
index 0247127..4fb67bb 100644 (file)
@@ -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"),
index 986c722..df92b1c 100644 (file)
@@ -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.");
index 25f9757..dea3a61 100644 (file)
@@ -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();
         }