diff options
| author | roundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2005-10-07 14:17:08 +0000 |
|---|---|---|
| committer | roundcube <roundcube@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2005-10-07 14:17:08 +0000 |
| commit | 42598a6bfeb4f154425dc8eda993b3df8d22d36a (patch) | |
| tree | a0b5735c2f1830fcbb16756f97ddd0f6e9b8b926 /roundcubemail/program/include/rcube_imap.inc | |
| parent | 083b33000fa063e11863e0b1f68e586adf4e1384 (diff) | |
Several bugfixes and feature improvements
git-svn-id: https://svn.roundcube.net/trunk@21 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_imap.inc')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.inc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/roundcubemail/program/include/rcube_imap.inc b/roundcubemail/program/include/rcube_imap.inc index 127409dc8..21434167b 100644 --- a/roundcubemail/program/include/rcube_imap.inc +++ b/roundcubemail/program/include/rcube_imap.inc @@ -24,9 +24,6 @@ require_once('lib/imap.inc'); require_once('lib/mime.inc'); -// check for Open-SSL support in PHP build -//$ICL_SSL = TRUE; -//$ICL_PORT = 993; class rcube_imap { @@ -75,15 +72,29 @@ class rcube_imap } - function connect($host, $user, $pass, $port=143) + function connect($host, $user, $pass, $port=143, $use_ssl=FALSE) { - global $ICL_PORT; + global $ICL_PORT, $CONFIG; + + // check for Open-SSL support in PHP build + if ($use_ssl && in_array('openssl', get_loaded_extensions())) + $ICL_SSL = TRUE; $ICL_PORT = $port; - $this->conn = iil_Connect($host, $user, $pass); + $this->conn = iil_Connect($host, $user, $pass, array('imap' => 'check')); $this->host = $host; $this->user = $user; $this->pass = $pass; + + if ($this->conn && ($CONFIG['debug_level'] & 8)) + print $this->conn->message; + + else if (!$this->conn && $GLOBALS['iil_error']) + { + raise_error(array('code' => 403, + 'type' => 'imap', + 'message' => $GLOBALS['iil_error']), TRUE, FALSE); + } return $this->conn ? TRUE : FALSE; } |
