diff --git a/lib/Horde/Core/Auth/Application.php b/lib/Horde/Core/Auth/Application.php index 17aef637d..7b8c06ca0 100644 --- a/lib/Horde/Core/Auth/Application.php +++ b/lib/Horde/Core/Auth/Application.php @@ -128,10 +128,12 @@ public function authenticate($userId, $credentials, $login = true) return false; } - try { - list($userId, $credentials) = $this->runHook(trim($userId), $credentials, 'preauthenticate', 'authenticate'); - } catch (Horde_Auth_Exception $e) { - return false; + if ($login) { + try { + list($userId, $credentials) = $this->runHook(trim($userId), $credentials, 'preauthenticate', 'authenticate'); + } catch (Horde_Auth_Exception $e) { + return false; + } } if ($this->_base) { @@ -141,7 +143,9 @@ public function authenticate($userId, $credentials, $login = true) } elseif (!parent::authenticate($userId, $credentials, $login)) { return false; } - + if (!$login) { + return true; + } /* Remember the user's mode choice, if applicable. */ if (!empty($credentials['mode'])) { $this->_view = $credentials['mode']; diff --git a/lib/Horde/Core/Factory/Auth.php b/lib/Horde/Core/Factory/Auth.php index 6a582fb8b..6f91e528f 100644 --- a/lib/Horde/Core/Factory/Auth.php +++ b/lib/Horde/Core/Factory/Auth.php @@ -1,4 +1,5 @@ _create($params['primary_driver']['driver'], $params['primary_driver']['params']); + } + if (!empty($params['fallback_driver'])) { + $params['fallback_driver'] = $this->_create($params['fallback_driver']['driver'], $params['fallback_driver']['params']); + } + break; + case 'horde_auth_cyrsql': $imap_config = array( 'hostspec' => empty($params['cyrhost']) ? null : $params['cyrhost'], @@ -188,5 +200,4 @@ protected function _create($driver, $orig_params = null) return $auth_ob; } - }