Bug #8842: Don't throw exception for a transparent() authentication failure
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 9 Mar 2010 04:11:00 +0000 (21:11 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 9 Mar 2010 04:11:00 +0000 (21:11 -0700)
framework/Auth/lib/Horde/Auth/Application.php
imp/lib/Auth.php

index 7a23842..ea8268e 100644 (file)
@@ -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()
     {
index fdc4e87..166d9eb 100644 (file)
@@ -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;
+        }
     }
 
     /**