summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcmail.php
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-02-21 16:44:39 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-02-21 16:44:39 +0000
commit9989376b95d55ed752b2e3f6e8dbf42257f5ce77 (patch)
treea9f5c8bce703932d57782d28bd9a3799ba257ab4 /roundcubemail/program/include/rcmail.php
parentd91a62c9ec99c3a33fe135e73da1cdce0c33ec09 (diff)
Use rcmail::imap_connect() to establish IMAP connections; always initialize rcube_imap object in mail steps
git-svn-id: https://svn.roundcube.net/trunk@3278 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcmail.php')
-rw-r--r--roundcubemail/program/include/rcmail.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/roundcubemail/program/include/rcmail.php b/roundcubemail/program/include/rcmail.php
index 5d20989b2..b0d130e75 100644
--- a/roundcubemail/program/include/rcmail.php
+++ b/roundcubemail/program/include/rcmail.php
@@ -5,7 +5,7 @@
| program/include/rcmail.php |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2008-2009, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2008-2010, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
@@ -374,6 +374,10 @@ class rcmail
*/
public function imap_init($connect = false)
{
+ // already initialized
+ if (is_object($this->imap))
+ return;
+
$this->imap = new rcube_imap($this->db);
$this->imap->debug_level = $this->config->get('debug_level');
$this->imap->skip_deleted = $this->config->get('skip_deleted');
@@ -404,9 +408,13 @@ class rcmail
$hook = $this->plugins->exec_hook('imap_init', array('fetch_headers' => $this->imap->fetch_add_headers));
if ($hook['fetch_headers'])
$this->imap->fetch_add_headers = $hook['fetch_headers'];
-
- if ($connect)
+
+ // support this parameter for backward compatibility but log warning
+ if ($connect) {
$this->imap_connect();
+ raise_error(array('code' => 800, 'type' => 'imap', 'file' => __FILE__,
+ 'message' => "rcube::imap_init(true) is deprecated, use rcube::imap_connect() instead"), true, false);
+ }
}
@@ -841,7 +849,7 @@ class rcmail
if (!$this->authenticate_session())
return;
- $this->imap_init(true);
+ $this->imap_connect();
}
if ($config['logout_purge'] && !empty($config['trash_mbox'])) {