From 5936d6f0c83777f6c182c2b2708bb39117dc6d08 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 19 Jan 2011 23:37:29 -0700 Subject: [PATCH] Fix transparent login to imp if using preauthenticate hook --- imp/lib/Auth.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/imp/lib/Auth.php b/imp/lib/Auth.php index e9021ccf3..9b0b420d3 100644 --- a/imp/lib/Auth.php +++ b/imp/lib/Auth.php @@ -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 { -- 2.11.0