From fd6f79d24d3a6bdbea61d429da373a8893716bbf Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 4 Dec 2008 11:57:57 -0700 Subject: [PATCH] Make sure IMAP ob is rebuilt immediately --- imp/lib/Auth/imp.php | 2 +- imp/lib/IMAP.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/imp/lib/Auth/imp.php b/imp/lib/Auth/imp.php index 48a14ef70..b8f3d5ebe 100644 --- a/imp/lib/Auth/imp.php +++ b/imp/lib/Auth/imp.php @@ -45,7 +45,7 @@ class Auth_imp extends Auth function _authenticate($userID, $credentials) { // Check for valid IMAP Client object. - if (!$GLOBALS['imp_imap']->loadImapObject()) { + if (!$GLOBALS['imp_imap']->ob) { // Attempt to create IMAP Client object $key = isset($credentials['server']) ? $credentials['server'] : IMP_Session::getAutoLoginServer(); if (is_null($key) || diff --git a/imp/lib/IMAP.php b/imp/lib/IMAP.php index 04fdba865..944be60cc 100644 --- a/imp/lib/IMAP.php +++ b/imp/lib/IMAP.php @@ -48,6 +48,9 @@ class IMP_IMAP { /* Register the logging callback. */ Horde_Imap_Client_Exception::$logCallback = array($this, 'logException'); + + /* Rebuild the Horde_Imap_Client object. */ + $this->_loadImapObject(); } /** @@ -100,7 +103,7 @@ class IMP_IMAP * * @return boolean True on success, false on error. */ - public function loadImapObject() + protected function _loadImapObject() { if (!is_null($this->ob)) { return true; @@ -249,7 +252,6 @@ class IMP_IMAP public function getNamespaceList() { try { - $this->loadImapObject(); return $GLOBALS['imp_imap']->ob->getNamespaces(!empty($_SESSION['imp']['imap_ext']['namespace']) ? $_SESSION['imp']['imap_ext']['namespace'] : array()); } catch (Horde_Imap_Client_Exception $e) { // @todo Error handling -- 2.11.0