add a place to ensure that $this->_imppgp is initialized
authorChuck Hagenbuch <chuck@horde.org>
Wed, 12 Aug 2009 01:04:56 +0000 (21:04 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Wed, 12 Aug 2009 01:04:56 +0000 (21:04 -0400)
imp/lib/Mime/Viewer/Pgp.php

index d0aec8e..3e9a620 100644 (file)
@@ -266,6 +266,16 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver
      */
     protected function _outputPGPKey()
     {
+        /* Is PGP active? */
+        if (empty($GLOBALS['conf']['gnupg']['path']) ||
+            !$GLOBALS['prefs']->getValue('use_pgp')) {
+            return array();
+        }
+
+        if (empty($this->_imppgp)) {
+            $this->_imppgp = Horde_Crypt::singleton(array('IMP', 'Pgp'));
+        }
+
         /* Initialize status message. */
         $status = array(
             'icon' => Horde::img('mime/encryption.png', 'PGP'),