Move getProvider() from horde/Auth to horde/Core
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 2 Jun 2010 17:17:40 +0000 (11:17 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 2 Jun 2010 19:54:04 +0000 (13:54 -0600)
folks/edit/password.php
framework/Auth/lib/Horde/Auth.php
framework/Core/lib/Horde/Registry.php
gollem/lib/Auth.php
passwd/lib/Passwd.php

index f02457d..eee926e 100644 (file)
@@ -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']);
         }
index 8adc44a..5a25861 100644 (file)
@@ -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).
index 9687267..cdc8ada 100644 (file)
@@ -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?
index a784bc4..2930802 100644 (file)
@@ -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);
     }
index 2d947c2..a12cd82 100644 (file)
@@ -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);
             }
         }
     }