Use pgp form field only if gnupg is installed and configured.
authorJan Schneider <jan@horde.org>
Mon, 20 Jul 2009 10:33:01 +0000 (12:33 +0200)
committerJan Schneider <jan@horde.org>
Mon, 20 Jul 2009 10:33:01 +0000 (12:33 +0200)
turba/config/attributes.php.dist

index c61b8d0..931a4ae 100644 (file)
@@ -335,12 +335,21 @@ $attributes['freebusyUrl'] = array(
     'required' => false,
     'params' => array('regex' => '', 'size' => 40, 'maxlength' => 255)
 );
-$attributes['pgpPublicKey'] = array(
-    'label' => _("PGP Public Key"),
-    'type' => 'pgp',
-    'required' => false,
-    'params' => array('gpg' => $GLOBALS['conf']['gnupg']['path'], 'temp_dir' => Horde::getTempDir(), 'rows' => 3, 'cols' => 40)
-);
+if (!empty($GLOBALS['conf']['gnupg']['path'])) {
+    $attributes['pgpPublicKey'] = array(
+        'label' => _("PGP Public Key"),
+        'type' => 'pgp',
+        'required' => false,
+        'params' => array('gpg' => $GLOBALS['conf']['gnupg']['path'], 'temp_dir' => Horde::getTempDir(), 'rows' => 3, 'cols' => 40)
+    );
+} else {
+    $attributes['pgpPublicKey'] = array(
+        'label' => _("PGP Public Key"),
+        'type' => 'longtext',
+        'required' => false,
+        'params' => array('rows' => 3, 'cols' => 40)
+    );
+}
 $attributes['smimePublicKey'] = array(
     'label' => _("S/MIME Public Certificate"),
     'type' => 'smime',