Fix _imp_server() to get the servername from the imap_ob
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 7 Jun 2009 19:31:08 +0000 (15:31 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 7 Jun 2009 19:31:08 +0000 (15:31 -0400)
imp/lib/api.php

index 6c298fe..9afd8b2 100644 (file)
@@ -438,9 +438,12 @@ function _imp_server()
     $GLOBALS['authentication'] = 'none';
     require_once dirname(__FILE__) . '/base.php';
 
-    return IMP::checkAuthentication(true)
-        ? $_SESSION['imp']['server']
-        : null;
+    if (IMP::checkAuthentication(true)) {
+        $imap_obj = unserialize($_SESSION['imp']['imap_ob']);
+        return $imap_obj->getParam('hostspec');
+    } else {
+        return null;
+    }
 }
 
 /**