Make sure IMAP ob is rebuilt immediately
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 4 Dec 2008 18:57:57 +0000 (11:57 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 4 Dec 2008 21:23:52 +0000 (14:23 -0700)
imp/lib/Auth/imp.php
imp/lib/IMAP.php

index 48a14ef..b8f3d5e 100644 (file)
@@ -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) ||
index 04fdba8..944be60 100644 (file)
@@ -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