From: Michael M Slusarz Date: Wed, 2 Jun 2010 17:17:40 +0000 (-0600) Subject: Move getProvider() from horde/Auth to horde/Core X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=45733891bd334af239619a1540ecb3271634928c;p=horde.git Move getProvider() from horde/Auth to horde/Core --- diff --git a/folks/edit/password.php b/folks/edit/password.php index f02457dff..eee926ed2 100644 --- a/folks/edit/password.php +++ b/folks/edit/password.php @@ -162,7 +162,7 @@ do { if (Horde_Auth::getCredential('password') == $info['old']) { Horde_Auth::setCredential('password', $info['new']); $secret = $injector->getInstance('Horde_Secret'); - if (Horde_Auth::getProvider() == 'imp' || + if ($registry->getProvider() == 'imp' || !empty($_SESSION['imp']['pass'])) { $_SESSION['imp']['pass'] = $secret->write($secret->getKey('imp'), $info['new']); } diff --git a/framework/Auth/lib/Horde/Auth.php b/framework/Auth/lib/Horde/Auth.php index 8adc44a41..5a258617d 100644 --- a/framework/Auth/lib/Horde/Auth.php +++ b/framework/Auth/lib/Horde/Auth.php @@ -670,19 +670,6 @@ class Horde_Auth } /** - * Returns the name of the authentication provider. - * - * @return string The name of the driver currently providing - * authentication, or false if not set. - */ - static public function getProvider() - { - return empty($_SESSION['horde_auth']['driver']) - ? false - : $_SESSION['horde_auth']['driver']; - } - - /** * Sets the error message for an invalid authentication. * * @param string $type The type of error (self::REASON_* constant). diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 9687267f8..cdc8adafa 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -1589,6 +1589,19 @@ class Horde_Registry } /** + * Returns the name of the authentication provider. + * + * @return string The name of the driver currently providing + * authentication, or false if not set. + */ + public function getProvider() + { + return empty($_SESSION['horde_auth']['driver']) + ? false + : $_SESSION['horde_auth']['driver']; + } + + /** * Clears any authentication tokens in the current session. * * @param boolean $destroy Destroy the session? diff --git a/gollem/lib/Auth.php b/gollem/lib/Auth.php index a784bc4f4..2930802dc 100644 --- a/gollem/lib/Auth.php +++ b/gollem/lib/Auth.php @@ -63,7 +63,7 @@ class Gollem_Auth $credentials = array('password' => $secret->read($secret->getKey('gollem'), $GLOBALS['gollem_be']['params']['password'])); } - $login = ($login && (Horde_Auth::getProvider() == 'gollem')); + $login = ($login && ($GLOBALS['registry']->getProvider() == 'gollem')); return parent::authenticate($userID, $credentials, $login); } diff --git a/passwd/lib/Passwd.php b/passwd/lib/Passwd.php index 2d947c23d..a12cd8275 100644 --- a/passwd/lib/Passwd.php +++ b/passwd/lib/Passwd.php @@ -47,7 +47,7 @@ class Passwd { } /** - * Change the Horde/IMP/MIMP cached credentials. Should be called + * Change the Horde/IMP cached credentials. Should be called * only after a successful change of the password in the actual * backend storage. This routine is the same for all backends and * should not be implemented in the backend classes. @@ -60,12 +60,9 @@ class Passwd { { if (Auth::getCredential('password') == $old_password) { Auth::setCredential('password', $new_password); - if (Auth::getProvider() == 'imp') { + if ($GLOBALS['registry']->getProvider() == 'imp') { $_SESSION['imp']['pass'] = Secret::write(Secret::getKey('imp'), $new_password); - } elseif (Auth::getProvider() == 'mimp') { - $_SESSION['mimp']['pass'] = Secret::write(Secret::getKey('mimp'), - $new_password); } } }