From: Michael M Slusarz Date: Mon, 17 Aug 2009 23:54:29 +0000 (-0600) Subject: Bug #8498: If not logged in, and doing horde auth, use auth driver rather than applic... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=397d5f834f62283dd9b8591d1dc247f17a323cbf;p=horde.git Bug #8498: If not logged in, and doing horde auth, use auth driver rather than application driver --- diff --git a/framework/Auth/lib/Horde/Auth.php b/framework/Auth/lib/Horde/Auth.php index 9dc34f8b2..3cfc81bef 100644 --- a/framework/Auth/lib/Horde/Auth.php +++ b/framework/Auth/lib/Horde/Auth.php @@ -366,22 +366,22 @@ class Horde_Auth */ static public function isAuthenticated($options = array()) { - $driver = empty($options['app']) - ? $GLOBALS['conf']['auth']['driver'] - : $options['app']; - $is_auth = self::getAuth(); - /* Check for cached authentication results. */ - if ($is_auth && - (($_SESSION['horde_auth']['driver'] == $driver) || - isset($_SESSION['horde_auth']['app'][$driver]))) { - return self::checkExistingAuth(); + if (self::getAuth()) { + $driver = (empty($options['app']) || ($options['app'] == 'horde')) + ? $GLOBALS['conf']['auth']['driver'] + : $options['app']; + + if (($_SESSION['horde_auth']['driver'] == $driver) || + isset($_SESSION['horde_auth']['app'][$driver])) { + return self::checkExistingAuth(); + } } /* Try transparent authentication. */ - $auth = empty($options['app']) - ? self::singleton($driver) - : self::singleton('application', array('app' => $driver)); + $auth = (empty($options['app']) || ($options['app'] == 'horde')) + ? self::singleton($GLOBALS['conf']['auth']['driver']) + : self::singleton('application', array('app' => $options['app'])); return $auth->transparent(); }