[dev] Small patch to IMP's prefs.php

Etienne Goyer etienne.goyer at linuxquebec.com
Mon May 3 13:46:10 PDT 2004


Hi,

In imp/config/conf.xml, the "gnupg" option is marked as optionnal 
(required="false").  If this prefs is inexistant in conf.php, the "PGP 
Options" preferences group is still shown, but if you click it you get a 
nasty error message from the Crypt_pgp class.  A somewhat similar 
problem could occur if openssl_cafile pref is undefined (not tested). 
Here is a trivial patch to fix this.

Talking about this, should the PGP and S/MIME preferences groups be 
hidden if the use_pgp/use_smime prefs are false and locked ?  It would 
make the preference dialog tidier.

Thanks

--- prefs.php.dist.orig 2004-05-03 16:21:27.000000000 -0400
+++ prefs.php.dist      2004-05-03 16:22:34.000000000 -0400
@@ -135,14 +135,16 @@
      'members' => array('auto_expand', 'save_recipients', 
'display_contact', 'sourceselect')
  );

-$prefGroups['pgp'] = array(
-    'column' => _("Other Options"),
-    'label' => _("PGP Options"),
-    'desc' => sprintf(_("Control PGP support for %s."), 
$GLOBALS['registry']->getParam('name')),
-    'url' => 'pgp.php'
-);
+if (isset($GLOBALS['conf']['utils']['gnupg'])) {
+    $prefGroups['pgp'] = array(
+        'column' => _("Other Options"),
+        'label' => _("PGP Options"),
+        'desc' => sprintf(_("Control PGP support for %s."), 
$GLOBALS['registry']->getParam('name')),
+        'url' => 'pgp.php'
+    );
+}

-if (extension_loaded('openssl')) {
+if (extension_loaded('openssl') and 
isset($GLOBALS['conf']['utils']['openssl_cafile'])) {
      $prefGroups['smime'] = array(
          'column' => _("Other Options"),
          'label' => _("S/MIME Options"),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.horde.org/archives/dev/attachments/20040503/a556e351/signature.bin


More information about the dev mailing list