From d560e78d98b291efd8db777e944bf57bb1b577e8 Mon Sep 17 00:00:00 2001 From: alecpl Date: Tue, 21 Sep 2010 07:54:21 +0000 Subject: [PATCH] - Fix: close properly IMAP connection also when user is not logged in --- program/include/rcube_imap.php | 3 +-- program/include/rcube_imap_generic.php | 2 +- 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); }