From: Michael M Slusarz Date: Fri, 8 Oct 2010 23:30:32 +0000 (-0600) Subject: No need to store credentials for app if it is the same as the base horde credentials X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=465430cbe4ff3840d08b033231bb3c0a373b6121;p=horde.git No need to store credentials for app if it is the same as the base horde credentials --- diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 74ddbdca8..67e407266 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -1922,7 +1922,17 @@ class Horde_Registry } $secret = $GLOBALS['injector']->getInstance('Horde_Secret'); - $_SESSION['horde_auth']['app'][$app] = $secret->write($secret->getKey('auth'), serialize($credentials)); + $entry = $secret->write($secret->getKey('auth'), serialize($credentials)); + + if (isset($_SESSION['horde_auth']['credentials'])) { + $base_app = $_SESSION['horde_auth']['credentials']; + if (isset($_SESSION['horde_auth']['app'][$base_app]) && + ($_SESSION['horde_auth']['app'][$base_app] == $entry)) { + $entry = null; + } + } + + $_SESSION['horde_auth']['app'][$app] = $entry; } /** @@ -1938,8 +1948,15 @@ class Horde_Registry return false; } + $base_app = $_SESSION['horde_auth']['credentials']; if (is_null($app)) { - $app = $_SESSION['horde_auth']['credentials']; + $app = $base_app; + } + + if (empty($_SESSION['horde_auth']['app'][$app])) { + return ($base_app != $app) + ? $this->_getAuthCredentials($app) + : false; } $secret = $GLOBALS['injector']->getInstance('Horde_Secret');