Allow authentication drivers to explicity throw a REASON_MESSAGE exception.
authorJan Schneider <jan@horde.org>
Mon, 20 Sep 2010 09:21:48 +0000 (11:21 +0200)
committerJan Schneider <jan@horde.org>
Mon, 20 Sep 2010 09:30:19 +0000 (11:30 +0200)
framework/Auth/lib/Horde/Auth/Base.php

index a52d0bf..c1fe008 100644 (file)
@@ -111,8 +111,9 @@ abstract class Horde_Auth_Base
             $this->setCredential('credentials', $credentials);
             return true;
         } catch (Horde_Auth_Exception $e) {
-            if ($e->getCode()) {
-                $this->setError($e->getCode());
+            if (($code = $e->getCode()) &&
+                $code != Horde_Auth::REASON_MESSAGE) {
+                $this->setError($code);
             } else {
                 $this->setError(Horde_Auth::REASON_MESSAGE, $e->getMessage());
             }