From: Michael M Slusarz Date: Thu, 25 Mar 2010 20:27:20 +0000 (-0600) Subject: Remove Horde_Core dependency in Horde_Crypt X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=de347bba139d81860155af2c4b215eeccc180746;p=horde.git Remove Horde_Core dependency in Horde_Crypt --- diff --git a/framework/Crypt/lib/Horde/Crypt.php b/framework/Crypt/lib/Horde/Crypt.php index 50b64fa13..2aa6b071c 100644 --- a/framework/Crypt/lib/Horde/Crypt.php +++ b/framework/Crypt/lib/Horde/Crypt.php @@ -14,13 +14,6 @@ class Horde_Crypt { /** - * Singleton instances. - * - * @var array - */ - static protected $_instances = array(); - - /** * The temporary directory to use. * * @var string @@ -64,35 +57,22 @@ class Horde_Crypt } /** - * Attempts to return a reference to a concrete Horde_Crypt instance - * based on $driver. It will only create a new instance if no - * Horde_Crypt instance with the same parameters currently exists. + * Constructor. * - * This should be used if multiple crypto backends (and, thus, - * multiple Horde_Crypt instances) are required. + * @param array $params Configuration parameters: + *
+     * 'temp' - (string) [REQUIRED] Location of temporary directory.
+     * 
* - * This method must be invoked as: $var = Horde_Crypt::singleton() - * - * @param mixed $driver The type of concrete Horde_Crypt subclass to - * return. If $driver is an array, then we will look - * in $driver[0]/lib/Crypt/ for the subclass - * implementation named $driver[1].php. - * @param array $params A hash containing any additional configuration or - * connection parameters a subclass might need. - * - * @return Horde_Crypt The concrete Horde_Crypt reference. - * @throws Horde_Exception + * @throws InvalidArgumentException */ - static public function singleton($driver, $params = array()) + public function __construct($params = array()) { - ksort($params); - $signature = hash('md5', serialize(array($driver, $params))); - - if (!isset(self::$_instances[$signature])) { - self::$_instances[$signature] = self::factory($driver, $params); + if (empty($params['temp'])) { + throw new InvalidArgumentException('A temporary directory must be provided.'); } - return self::$_instances[$signature]; + $this->_tempdir = Horde_Util::createTempDir(true, $params['temp']); } /** diff --git a/framework/Crypt/lib/Horde/Crypt/Pgp.php b/framework/Crypt/lib/Horde/Crypt/Pgp.php index 03fd21a1b..1d3a8a62a 100644 --- a/framework/Crypt/lib/Horde/Crypt/Pgp.php +++ b/framework/Crypt/lib/Horde/Crypt/Pgp.php @@ -117,22 +117,30 @@ class Horde_Crypt_Pgp extends Horde_Crypt protected $_privateKeyring; /** + * Configuration parameters. + * + * @var array + */ + protected $_params = array(); + + /** * Constructor. * * @param array $params The following parameters: *
      * 'program' - (string) [REQUIRED] The path to the GnuPG binary.
-     * 'temp' - (string) [OPTIONAL] Path to a temporary directory.
+     * 'proxy_host - (string) Proxy host.
+     * 'proxy_port - (integer) Proxy port.
      * 
* - * @throws Horde_Exception + * @throws InvalidArgumentException */ - protected function __construct($params = array()) + public function __construct($params = array()) { - $this->_tempdir = Horde_Util::createTempDir(true, $params['temp']); + parent::__construct($params); if (empty($params['program'])) { - throw new Horde_Exception('The location of the GnuPG binary must be given to the Horde_Crypt_Pgp:: class.'); + throw new InvalidArgumentException('The location of the GnuPG binary must be given to the Horde_Crypt_Pgp:: class.'); } /* Store the location of GnuPG and set common options. */ @@ -149,6 +157,8 @@ class Horde_Crypt_Pgp extends Horde_Crypt if (strncasecmp(PHP_OS, 'WIN', 3)) { array_unshift($this->_gnupg, 'LANG= ;'); } + + $this->_params = $params; } /** @@ -880,11 +890,11 @@ class Horde_Crypt_Pgp extends Horde_Crypt /** * Connects to a public key server via HKP (Horrowitz Keyserver Protocol). * - * @param string $method POST, GET, etc. - * @param string $server The keyserver to use. - * @param string $uri The URI to access (relative to the server). - * @param string $command The PGP command to run. - * @param float $timeout The timeout value. + * @param string $method POST, GET, etc. + * @param string $server The keyserver to use. + * @param string $resource The URI to access (relative to the server). + * @param string $command The PGP command to run. + * @param float $timeout The timeout value. * * @return string The text from standard output on success. * @throws Horde_Exception @@ -896,15 +906,13 @@ class Horde_Crypt_Pgp extends Horde_Crypt $output = ''; $port = '11371'; - if (!empty($GLOBALS['conf']['http']['proxy']['proxy_host'])) { + if (!empty($this->_params['proxy_host'])) { $resource = 'http://' . $server . ':' . $port . $resource; - $server = $GLOBALS['conf']['http']['proxy']['proxy_host']; - if (!empty($GLOBALS['conf']['http']['proxy']['proxy_port'])) { - $port = $GLOBALS['conf']['http']['proxy']['proxy_port']; - } else { - $port = 80; - } + $server = $this->_params['proxy_host']; + $port = isset($this->_params['proxy_port']) + ? $this->_params['proxy_port'] + : 80; } $command = $method . ' ' . $resource . ' HTTP/1.0' . ($command ? "\r\n" . $command : ''); diff --git a/framework/Crypt/lib/Horde/Crypt/Smime.php b/framework/Crypt/lib/Horde/Crypt/Smime.php index bf9794930..856cf8230 100644 --- a/framework/Crypt/lib/Horde/Crypt/Smime.php +++ b/framework/Crypt/lib/Horde/Crypt/Smime.php @@ -62,17 +62,6 @@ class Horde_Crypt_Smime extends Horde_Crypt ); /** - * Constructor. - * - * @param array $params Parameter array. - * 'temp' => Location of temporary directory. - */ - protected function __construct($params) - { - $this->_tempdir = $params['temp']; - } - - /** * Verify a passphrase for a given private key. * * @param string $private_key The user's private key. diff --git a/framework/Nls/package.xml b/framework/Nls/package.xml index 699b0edb1..9b25f52d6 100644 --- a/framework/Nls/package.xml +++ b/framework/Nls/package.xml @@ -61,6 +61,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> pear.horde.org + Core + pear.horde.org + + Util pear.horde.org diff --git a/framework/Tree/package.xml b/framework/Tree/package.xml index f50927ec8..da0e0f38a 100644 --- a/framework/Tree/package.xml +++ b/framework/Tree/package.xml @@ -55,6 +55,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> 1.7.0 + Core + pear.horde.org + + Util pear.horde.org diff --git a/imp/compose.php b/imp/compose.php index d0b845709..974a5509c 100644 --- a/imp/compose.php +++ b/imp/compose.php @@ -673,7 +673,7 @@ if ($prefs->getValue('use_pgp') && !$prefs->isLocked('default_encrypt')) { try { $addrs = $imp_compose->recipientList($header); if (!empty($addrs['list'])) { - $imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); + $imp_pgp = $injector->getInstance('IMP_Crypt_Pgp'); foreach ($addrs['list'] as $val) { $imp_pgp->getPublicKey($val); } diff --git a/imp/lib/Ajax/Imple/PassphraseDialog.php b/imp/lib/Ajax/Imple/PassphraseDialog.php index 43e5b09f7..e0abbb0c6 100644 --- a/imp/lib/Ajax/Imple/PassphraseDialog.php +++ b/imp/lib/Ajax/Imple/PassphraseDialog.php @@ -133,7 +133,7 @@ class IMP_Ajax_Imple_PassphraseDialog extends Horde_Ajax_Imple_Base case 'pgpPersonal': case 'pgpSymmetric': if ($this->_vars->dialog_input) { - $imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); + $imp_pgp = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp'); if ((($vars->type == 'pgpPersonal') && $imp_pgp->storePassphrase('personal', $this->_vars->dialog_input)) || (($vars->type == 'pgpSymmeetric') && @@ -149,7 +149,7 @@ class IMP_Ajax_Imple_PassphraseDialog extends Horde_Ajax_Imple_Base case 'smimePersonal': if ($this->_vars->dialog_input) { - $imp_smime = Horde_Crypt::singleton(array('IMP', 'Smime')); + $imp_smime = $GLOBALS['injector']->getInstance('IMP_Crypt_Smime'); if ($imp_smime->storePassphrase($this->_vars->dialog_input)) { $result->success = 1; } else { diff --git a/imp/lib/Application.php b/imp/lib/Application.php index 54c811bf6..ef334a84c 100644 --- a/imp/lib/Application.php +++ b/imp/lib/Application.php @@ -100,6 +100,8 @@ class IMP_Application extends Horde_Registry_Application { /* Add IMP-specific binders. */ $binders = array( + 'IMP_Crypt_Pgp' => new IMP_Injector_Binder_Pgp(), + 'IMP_Crypt_Smime' => new IMP_Injector_Binder_Smime(), 'IMP_Folder' => new IMP_Injector_Binder_Folder(), 'IMP_Imap_Tree' => new IMP_Injector_Binder_Imaptree(), 'IMP_Sentmail' => new IMP_Injector_Binder_Sentmail() diff --git a/imp/lib/Compose.php b/imp/lib/Compose.php index 6859287c4..4b5706317 100644 --- a/imp/lib/Compose.php +++ b/imp/lib/Compose.php @@ -1183,7 +1183,7 @@ class IMP_Compose if ($attach_flag) { if ($this->_pgpAttachPubkey) { - $imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); + $imp_pgp = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp'); $base->addPart($imp_pgp->publicKeyMIMEPart()); } @@ -1197,7 +1197,7 @@ class IMP_Compose if ($GLOBALS['prefs']->getValue('use_pgp') && !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')); + $imp_pgp = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp'); switch ($encrypt) { case IMP::PGP_SIGN: @@ -1253,7 +1253,7 @@ class IMP_Compose } } elseif ($GLOBALS['prefs']->getValue('use_smime') && in_array($encrypt, array(IMP::SMIME_ENCRYPT, IMP::SMIME_SIGN, IMP::SMIME_SIGNENC))) { - $imp_smime = Horde_Crypt::singleton(array('IMP', 'Smime')); + $imp_smime = $GLOBALS['injector']->getInstance('IMP_Crypt_Smime'); /* Check to see if we have the user's passphrase yet. */ if (in_array($encrypt, array(IMP::SMIME_SIGN, IMP::SMIME_SIGNENC))) { diff --git a/imp/lib/Crypt/Pgp.php b/imp/lib/Crypt/Pgp.php index 43eeede0c..6ecdd181a 100644 --- a/imp/lib/Crypt/Pgp.php +++ b/imp/lib/Crypt/Pgp.php @@ -17,17 +17,6 @@ class IMP_Crypt_Pgp extends Horde_Crypt_Pgp const PUBKEY_FIELD = 'pgpPublicKey'; /** - * Constructor - */ - public function __construct() - { - parent::__construct(array( - 'program' => $GLOBALS['conf']['gnupg']['path'], - 'temp' => Horde::getTempDir() - )); - } - - /** * Generate the personal Public/Private keypair and store in prefs. * * @param string $realname See Horde_Crypt_Pgp:: diff --git a/imp/lib/Crypt/Smime.php b/imp/lib/Crypt/Smime.php index e42d7882f..5cf384150 100644 --- a/imp/lib/Crypt/Smime.php +++ b/imp/lib/Crypt/Smime.php @@ -17,14 +17,6 @@ class IMP_Crypt_Smime extends Horde_Crypt_Smime const PUBKEY_FIELD = 'smimePublicKey'; /** - * Constructor. - */ - public function __construct() - { - parent::__construct(array('temp' => Horde::getTempDir())); - } - - /** * Add the personal public key to the prefs. * * @param mixed $key The public key to add (either string or array). diff --git a/imp/lib/Injector/Binder/Pgp.php b/imp/lib/Injector/Binder/Pgp.php new file mode 100644 index 000000000..7fcfdf8bd --- /dev/null +++ b/imp/lib/Injector/Binder/Pgp.php @@ -0,0 +1,41 @@ + + * @package IMP + */ +class IMP_Injector_Binder_Pgp implements Horde_Injector_Binder +{ + /** + */ + public function create(Horde_Injector $injector) + { + $params = array( + 'program' => $GLOBALS['conf']['gnupg']['path'], + 'temp' => Horde::getTempDir() + ); + + if (isset($GLOBALS['conf']['http']['proxy']['proxy_host'])) { + $params['proxy_host'] = $GLOBALS['conf']['http']['proxy']['proxy_host']; + if (isset($GLOBALS['conf']['http']['proxy']['proxy_port'])) { + $params['proxy_port'] = $GLOBALS['conf']['http']['proxy']['proxy_port']; + } + } + + return Horde_Crypt::factory(array('IMP', 'Pgp'), $params); + } + + /** + */ + public function equals(Horde_Injector_Binder $binder) + { + return false; + } + +} diff --git a/imp/lib/Injector/Binder/Smime.php b/imp/lib/Injector/Binder/Smime.php new file mode 100644 index 000000000..45bd8a512 --- /dev/null +++ b/imp/lib/Injector/Binder/Smime.php @@ -0,0 +1,31 @@ + + * @package IMP + */ +class IMP_Injector_Binder_Smime implements Horde_Injector_Binder +{ + /** + */ + public function create(Horde_Injector $injector) + { + return Horde_Crypt::factory(array('IMP', 'Smime'), array( + 'temp' => Horde::getTempDir() + )); + } + + /** + */ + public function equals(Horde_Injector_Binder $binder) + { + return false; + } + +} diff --git a/imp/lib/Mime/Viewer/Pgp.php b/imp/lib/Mime/Viewer/Pgp.php index 28edf6879..ed6d8e735 100644 --- a/imp/lib/Mime/Viewer/Pgp.php +++ b/imp/lib/Mime/Viewer/Pgp.php @@ -49,13 +49,6 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver ); /** - * IMP_Crypt_Pgp object. - * - * @var IMP_Crypt_Pgp - */ - protected $_imppgp; - - /** * The address of the sender. * * @var string @@ -86,11 +79,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver ) ); - if (empty($this->_imppgp)) { - $this->_imppgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); - } - - $parts = $this->_imppgp->parsePGPData($this->_mimepart->getContents()); + $parts = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp')->parsePGPData($this->_mimepart->getContents()); foreach (array_keys($parts) as $key) { if ($parts[$key]['type'] == Horde_Crypt_Pgp::ARMOR_SIGNATURE) { $ret[$id]['data'] = implode("\r\n", $parts[$key]['data']); @@ -110,11 +99,6 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver { $id = $this->_mimepart->getMimeId(); - if (empty($this->_imppgp) && - !empty($GLOBALS['conf']['gnupg']['path'])) { - $this->_imppgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); - } - if (Horde_Util::getFormData('rawpgpkey')) { return array( $id => array( @@ -198,10 +182,6 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver return null; } - if (empty($this->_imppgp)) { - $this->_imppgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); - } - /* PGP version information appears in the first MIME subpart. We * don't currently need to do anything with this information. The * encrypted data appears in the second MIME subpart. */ @@ -212,10 +192,11 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver /* Check if this a symmetrically encrypted message. */ try { - $symmetric = $this->_imppgp->encryptedSymmetrically($encrypted_data); + $imp_pgp = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp'); + $symmetric = $imp_pgp->encryptedSymmetrically($encrypted_data); if ($symmetric) { $symmetric_id = $this->_getSymmetricID(); - $symmetric_pass = $this->_imppgp->getPassphrase('symmetric', $symmetric_id); + $symmetric_pass = $imp_pgp->getPassphrase('symmetric', $symmetric_id); if (is_null($symmetric_pass)) { $status[] = _("The data in this part has been encrypted via PGP."); @@ -235,7 +216,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver /* Check if this is a literal compressed message. */ try { - $info = $this->_imppgp->pgpPacketInformation($encrypted_data); + $info = $imp_pgp->pgpPacketInformation($encrypted_data); } catch (Horde_Exception $e) { Horde::logMessage($e, 'INFO'); return null; @@ -248,8 +229,8 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver $status[] = _("The data in this part has been encrypted via PGP."); if (!$symmetric) { - if ($this->_imppgp->getPersonalPrivateKey()) { - $personal_pass = $this->_imppgp->getPassphrase('personal'); + if ($imp_pgp->getPersonalPrivateKey()) { + $personal_pass = $imp_pgp->getPassphrase('personal'); if (is_null($personal_pass)) { /* Ask for the private key's passphrase if this is * encrypted asymmetrically. */ @@ -269,16 +250,16 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver try { if (!is_null($symmetric_pass)) { - $decrypted_data = $this->_imppgp->decryptMessage($encrypted_data, 'symmetric', $symmetric_pass); + $decrypted_data = $imp_pgp->decryptMessage($encrypted_data, 'symmetric', $symmetric_pass); } elseif (!is_null($personal_pass)) { - $decrypted_data = $this->_imppgp->decryptMessage($encrypted_data, 'personal', $personal_pass); + $decrypted_data = $imp_pgp->decryptMessage($encrypted_data, 'personal', $personal_pass); } else { - $decrypted_data = $this->_imppgp->decryptMessage($encrypted_data, 'literal'); + $decrypted_data = $imp_pgp->decryptMessage($encrypted_data, 'literal'); } } catch (Horde_Exception $e) { $status[] = _("The data in this part does not appear to be a valid PGP encrypted message. Error: ") . $e->getMessage(); if (!is_null($symmetric_pass)) { - $this->_imppgp->unsetPassphrase('symmetric', $this->_getSymmetricID()); + $imp_pgp->unsetPassphrase('symmetric', $this->_getSymmetricID()); return $this->_getEmbeddedMimeParts(); } return null; @@ -311,16 +292,17 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver ); $mime_id = $this->_mimepart->getMimeId(); + $imp_pgp = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp'); if ($GLOBALS['prefs']->getValue('use_pgp') && $GLOBALS['prefs']->getValue('add_source') && $GLOBALS['registry']->hasMethod('contacts/addField')) { - $status['text'][] = Horde::link('#', '', '', '', $this->_imppgp->savePublicKeyURL($this->_params['contents']->getMailbox(), $this->_params['contents']->getUid(), $mime_id) . 'return false;') . _("Save the key to your address book.") . ''; + $status['text'][] = Horde::link('#', '', '', '', $imp_pgp->savePublicKeyURL($this->_params['contents']->getMailbox(), $this->_params['contents']->getUid(), $mime_id) . 'return false;') . _("Save the key to your address book.") . ''; } $status['text'][] = $this->_params['contents']->linkViewJS($this->_mimepart, 'view_attach', _("View the raw text of the Public Key."), array('jstext' => _("View Public Key"), 'params' => array('mode' => IMP_Contents::RENDER_INLINE, 'rawpgpkey' => 1))); try { - $data = '' . nl2br(str_replace(' ', ' ', $this->_imppgp->pgpPrettyKey($this->_mimepart->getContents()))) . ''; + $data = '' . nl2br(str_replace(' ', ' ', $imp_pgp->pgpPrettyKey($this->_mimepart->getContents()))) . ''; } catch (Horde_Exception $e) { $data = $e->getMessage(); } @@ -377,9 +359,10 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver $sig_part = $this->_params['contents']->getMIMEPart($sig_id); try { + $imp_pgp = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp'); $sig_result = $sig_part->getMetadata('imp-pgp-signature') - ? $this->_imppgp->verifySignature($sig_part->getContents(array('canonical' => true)), $this->_address) - : $this->_imppgp->verifySignature($sig_part->replaceEOL($this->_params['contents']->getBodyPart($signed_id, array('mimeheaders' => true)), Horde_Mime_Part::RFC_EOL), $this->_address, $sig_part->getContents()); + ? $imp_pgp->verifySignature($sig_part->getContents(array('canonical' => true)), $this->_address) + : $imp_pgp->verifySignature($sig_part->replaceEOL($this->_params['contents']->getBodyPart($signed_id, array('mimeheaders' => true)), Horde_Mime_Part::RFC_EOL), $this->_address, $sig_part->getContents()); $icon = Horde::img('alerts/success.png', _("Success")); $sig_text = $sig_result->message; @@ -423,7 +406,7 @@ class IMP_Horde_Mime_Viewer_Pgp extends Horde_Mime_Viewer_Driver */ protected function _getSymmetricID() { - return $this->_imppgp->getSymmetricID($this->_params['contents']->getMailbox(), $this->_params['contents']->getUid(), $this->_mimepart->getMimeId()); + return $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp')->getSymmetricID($this->_params['contents']->getMailbox(), $this->_params['contents']->getUid(), $this->_mimepart->getMimeId()); } /** diff --git a/imp/lib/Mime/Viewer/Plain.php b/imp/lib/Mime/Viewer/Plain.php index b641f8072..0d93ff968 100644 --- a/imp/lib/Mime/Viewer/Plain.php +++ b/imp/lib/Mime/Viewer/Plain.php @@ -207,8 +207,7 @@ class IMP_Horde_Mime_Viewer_Plain extends Horde_Mime_Viewer_Plain protected function _parsePGP() { /* Avoid infinite loop. */ - $imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); - $parts = $imp_pgp->parsePGPData($this->_mimepart->getContents()); + $parts = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp')->parsePGPData($this->_mimepart->getContents()); if (empty($parts) || ((count($parts) == 1) && ($parts[0]['type'] == Horde_Crypt_Pgp::ARMOR_TEXT))) { diff --git a/imp/lib/Mime/Viewer/Smime.php b/imp/lib/Mime/Viewer/Smime.php index bbd32e168..46757f015 100644 --- a/imp/lib/Mime/Viewer/Smime.php +++ b/imp/lib/Mime/Viewer/Smime.php @@ -69,7 +69,7 @@ class IMP_Horde_Mime_Viewer_Smime extends Horde_Mime_Viewer_Driver if (is_null($this->_impsmime) && $GLOBALS['prefs']->getValue('use_smime')) { try { - $this->_impsmime = Horde_Crypt::singleton(array('IMP', 'Smime')); + $this->_impsmime = $GLOBALS['injector']->getInstance('IMP_Crypt_Smime'); $this->_impsmime->checkForOpenSSL(); } catch (Horde_Exception $e) { $this->_impsmime = null; diff --git a/imp/pgp.php b/imp/pgp.php index 28f576c9c..c1f8cda2a 100644 --- a/imp/pgp.php +++ b/imp/pgp.php @@ -14,7 +14,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('imp'); -$imp_pgp = Horde_Crypt::singleton(array('IMP', 'Pgp')); +$imp_pgp = $GLOBALS['injector']->getInstance('IMP_Crypt_Pgp'); $secure_check = Horde::isConnectionSecure(); /* Run through the action handlers */ diff --git a/imp/smime.php b/imp/smime.php index 589a3bc20..84ec9d507 100644 --- a/imp/smime.php +++ b/imp/smime.php @@ -15,7 +15,7 @@ require_once dirname(__FILE__) . '/lib/Application.php'; Horde_Registry::appInit('imp'); -$imp_smime = Horde_Crypt::singleton(array('IMP', 'Smime')); +$imp_smime = $GLOBALS['injector']->getInstance('IMP_Crypt_Smime'); /* Run through the action handlers */ $actionID = Horde_Util::getFormData('actionID');