Move session thread init to a more appropriate place
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 7 Dec 2009 22:15:17 +0000 (15:15 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 7 Dec 2009 22:15:22 +0000 (15:15 -0700)
imp/lib/Auth.php

index 0f506b0..aee362b 100644 (file)
@@ -81,14 +81,6 @@ class IMP_Auth
             throw new Horde_Auth_Exception($e->getMessage());
         }
 
-        /* Set the IMAP threading algorithm. */
-        $ptr = $GLOBALS['imp_imap']->loadServerConfig($credentials['server']);
-        if (strcasecmp($ptr['protocol'], 'imap') == 0) {
-            $_SESSION['imp']['imap']['thread'] = in_array(isset($ptr['thread']) ? strtoupper($ptr['thread']) : 'REFERENCES', $GLOBALS['imp_imap']->ob()->queryCapability('THREAD'))
-                ? 'REFERENCES'
-                : 'ORDEREDSUBJECT';
-        }
-
         return false;
     }
 
@@ -431,6 +423,11 @@ class IMP_Auth
                     }
                 }
             }
+
+            /* Set the IMAP threading algorithm. */
+            $sess['imap']['thread'] = in_array(isset($ptr['thread']) ? strtoupper($ptr['thread']) : 'REFERENCES', $GLOBALS['imp_imap']->ob()->queryCapability('THREAD'))
+                ? 'REFERENCES'
+                : 'ORDEREDSUBJECT';
         }
 
         /* Set the SMTP options, if needed. */