Fix transparent login to imp if using preauthenticate hook
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Jan 2011 06:37:29 +0000 (23:37 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Jan 2011 06:37:29 +0000 (23:37 -0700)
imp/lib/Auth.php

index e9021cc..9b0b420 100644 (file)
@@ -145,16 +145,18 @@ class IMP_Auth
      */
     static public function transparent($auth_ob)
     {
-        /* It is possible that preauthenticate() set the credentials.
-         * If so, use that information instead of hordeauth. */
-        if ($auth_ob->getCredential('transparent')) {
-            $credentials = $auth_ob->getCredential();
-        } else {
+        $credentials = $auth_ob->getCredential('credentials');
+
+        if (empty($credentials['transparent'])) {
             /* Attempt hordeauth authentication. */
             $credentials = self::_canAutoLogin();
             if ($credentials === false) {
                 return false;
             }
+        } else {
+            /* It is possible that preauthenticate() set the credentials.
+             * If so, use that information instead of hordeauth. */
+            $credentials['userId'] = $auth_ob->getCredential('userId');
         }
 
         try {