diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-08-07 16:22:30 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2009-08-07 16:22:30 +0000 |
| commit | 6646d5c5f18547879edc89dd3dd701c9e05ef78e (patch) | |
| tree | 4e7cbc7d0a2a3ec621e1542ef77f332ed0e0f933 | |
| parent | c1ab5896f649e0b8ece8a6000359d447a7dc0cb9 (diff) | |
Add 'imap_connect' hook (#1485956)
git-svn-id: https://svn.roundcube.net/trunk@2849 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/CHANGELOG | 2 | ||||
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/roundcubemail/CHANGELOG b/roundcubemail/CHANGELOG index f96f0aa7b..dc16c5346 100644 --- a/roundcubemail/CHANGELOG +++ b/roundcubemail/CHANGELOG @@ -1,6 +1,8 @@ CHANGELOG RoundCube Webmail =========================== +- Added 'imap_connect' hook (#1485956) +- Fix vcard_attachments plugin (#1486035) - Updated PEAR::Auth_SASL to 1.0.3 version - Use sequence names only with PostgreSQL (#1486018) - Re-designed User Preferences interface diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index aaa77849d..b27124582 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -70,6 +70,8 @@ class rcube_imap var $debug_level = 1; var $error_code = 0; var $options = array('imap' => 'check'); + + private $host, $user, $pass, $port, $ssl; /** @@ -101,19 +103,22 @@ class rcube_imap // check for Open-SSL support in PHP build if ($use_ssl && extension_loaded('openssl')) $ICL_SSL = $use_ssl == 'imaps' ? 'ssl' : $use_ssl; - else if ($use_ssl) - { + else if ($use_ssl) { raise_error(array('code' => 403, 'type' => 'imap', 'file' => __FILE__, 'message' => 'Open SSL not available;'), TRUE, FALSE); $port = 143; - } + } $ICL_PORT = $port; $IMAP_USE_INTERNAL_DATE = false; + + $data = rcmail::get_instance()->plugins->exec_hook('imap_connect', array('host' => $host, 'user' => $user)); + if (!empty($data['pass'])) + $pass = $data['pass']; - $this->conn = iil_Connect($host, $user, $pass, $this->options); - $this->host = $host; - $this->user = $user; + $this->conn = iil_Connect($data['host'], $data['user'], $pass, $this->options); + $this->host = $data['host']; + $this->user = $data['user']; $this->pass = $pass; $this->port = $port; $this->ssl = $use_ssl; |
