summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-09-21 07:54:21 +0000
committeralecpl <alec@alec.pl>2010-09-21 07:54:21 +0000
commitd560e78d98b291efd8db777e944bf57bb1b577e8 (patch)
tree222fe369417c7a253c8b22df4fdc083e32dd34da
parenta3de4f6054b02af4a58bd061d27a0afbca736a42 (diff)
- Fix: close properly IMAP connection also when user is not logged in
-rw-r--r--program/include/rcube_imap.php3
-rw-r--r--program/include/rcube_imap_generic.php2
2 files changed, 2 insertions, 3 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 3d9253975..2151f5c2b 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -156,8 +156,7 @@ class rcube_imap
*/
function close()
{
- if ($this->conn && $this->conn->connected())
- $this->conn->close();
+ $this->conn->close();
$this->write_cache();
}
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 2dc1e3750..96865e237 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -708,7 +708,7 @@ class rcube_imap_generic
function close()
{
- if ($this->putLine("I LOGOUT")) {
+ if ($this->logged && $this->putLine("I LOGOUT")) {
if (!feof($this->fp))
fgets($this->fp, 1024);
}