From 9d4149dddf111e8e0be758fef2f48f3676d765c7 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 8 Mar 2010 21:11:00 -0700 Subject: [PATCH] Bug #8842: Don't throw exception for a transparent() authentication failure --- framework/Auth/lib/Horde/Auth/Application.php | 1 - imp/lib/Auth.php | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/framework/Auth/lib/Horde/Auth/Application.php b/framework/Auth/lib/Horde/Auth/Application.php index 7a2384249..ea8268e89 100644 --- a/framework/Auth/lib/Horde/Auth/Application.php +++ b/framework/Auth/lib/Horde/Auth/Application.php @@ -249,7 +249,6 @@ class Horde_Auth_Application extends Horde_Auth_Base * single parameter: the current class instance. * * @return boolean Whether transparent login is supported. - * @throws Horde_Auth_Exception */ protected function _transparent() { diff --git a/imp/lib/Auth.php b/imp/lib/Auth.php index fdc4e87c8..166d9ebaa 100644 --- a/imp/lib/Auth.php +++ b/imp/lib/Auth.php @@ -85,7 +85,6 @@ class IMP_Auth * @param Horde_Auth_Application $auth_ob The authentication object. * * @return boolean Whether transparent login is supported. - * @throws Horde_Auth_Exception */ static public function transparent($auth_ob) { @@ -96,8 +95,12 @@ class IMP_Auth if (!isset($credentials['server'])) { $credentials['server'] = self::getAutoLoginServer(); } - self::_createSession($auth_ob->getCredential()); - return true; + try { + self::_createSession($auth_ob->getCredential()); + return true; + } catch (Horde_Auth_Exception $e) { + return false; + } } /* Attempt hordeauth authentication. */ @@ -106,8 +109,12 @@ class IMP_Auth return false; } - self::_createSession($credentials); - return true; + try { + self::_createSession($credentials); + return true; + } catch (Horde_Auth_Exception $e) { + return false; + } } /** -- 2.11.0