Move setCredential() and getCredential() to horde/Core
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 8 Jun 2010 19:28:16 +0000 (13:28 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 8 Jun 2010 21:16:21 +0000 (15:16 -0600)
Rename to setAuthCredential() and getAuthCredential() to map
getAuth()/setAuth() and to distinguish from Horde_Auth_Base's
[set|get]Credential().

27 files changed:
folks/edit/password.php
framework/Auth/lib/Horde/Auth.php
framework/Auth/lib/Horde/Auth/Base.php
framework/Auth/package.xml
framework/Core/lib/Horde/Core/Binder/Mail.php
framework/Core/lib/Horde/Core/Factory/KolabStorage.php
framework/Core/lib/Horde/Registry.php
framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Controller/FreebusyController.php
framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Base.php
framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Base.php
framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Kolab.php
framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php
framework/Rpc/lib/Horde/Rpc.php
gollem/lib/Auth.php
horde/services/changepassword.php
imp/config/hooks.php.dist
imp/lib/Auth.php
ingo/lib/Ingo.php
koward/lib/Koward.php
kronolith/calendars/remote_edit.php
kronolith/lib/Application.php
kronolith/lib/Kronolith.php
kronolith/lib/Storage/kolab.php
passwd/lib/Driver/ldap.php
passwd/lib/Passwd.php
turba/config/sources.php.dist
wicked/lib/Sync.php

index d27d94d..97f7714 100644 (file)
@@ -159,8 +159,8 @@ do {
     $notification->push(_("Password changed."), 'horde.success');
 
     // reset credentials so user is not forced to relogin
-    if (Horde_Auth::getCredential('password') == $info['old']) {
-        Horde_Auth::setCredential('password', $info['new']);
+    if ($registry->getAuthCredential('password') == $info['old']) {
+        $registry->setAuthCredential('password', $info['new']);
         $secret = $injector->getInstance('Horde_Secret');
         if ($registry->getProvider() == 'imp' ||
             !empty($_SESSION['imp']['pass'])) {
index f58e6d1..c182650 100644 (file)
@@ -354,77 +354,6 @@ class Horde_Auth
     }
 
     /**
-     * Returns the requested credential for the currently logged in user, if
-     * present.
-     *
-     * @param string $credential  The credential to retrieve.
-     * @param string $app         The app to query. Defaults to Horde.
-     *
-     * @return mixed  The requested credential, all credentials if $credential
-     *                is null, or false if no user is logged in.
-     */
-    static public function getCredential($credential = null, $app = null)
-    {
-        if (!$GLOBALS['registry']->getAuth()) {
-            return false;
-        }
-
-        $credentials = self::_getCredentials($app);
-
-        return is_null($credential)
-            ? $credentials
-            : ((is_array($credentials) && isset($credentials[$credential]))
-                   ? $credentials[$credential]
-                   : false);
-    }
-
-    /**
-     * Sets the requested credential for the currently logged in user.
-     *
-     * @param string $credential  The credential to set.
-     * @param string $value       The value to set the credential to.
-     * @param string $app         The app to update. Defaults to Horde.
-     */
-    static public function setCredential($credential, $value, $app = null)
-    {
-        if ($GLOBALS['registry']->getAuth()) {
-            $credentials = self::_getCredentials($app);
-
-            if ($credentials !== false) {
-                if (is_array($credentials)) {
-                    $credentials[$credential] = $value;
-                } else {
-                    $credentials = array($credential => $value);
-                }
-
-                $secret = $GLOBALS['injector']->getInstance('Horde_Secret');
-                $_SESSION['horde_auth']['app'][$app] = $secret->write($secret->getKey('auth'), serialize($credentials));
-            }
-        }
-    }
-
-    /**
-     * Get the list of credentials for a given app.
-     *
-     * @param string $app  The application name.
-     *
-     * @return mixed  True, false, or the credential list.
-     */
-    static protected function _getCredentials($app)
-    {
-        if (is_null($app)) {
-            $app = $_SESSION['horde_auth']['credentials'];
-        }
-
-        if (!isset($_SESSION['horde_auth']['app'])) {
-            return false;
-        }
-
-        $secret = $GLOBALS['injector']->getInstance('Horde_Secret');
-        return @unserialize($secret->read($secret->getKey('auth'), $_SESSION['horde_auth']['app'][$app]));
-    }
-
-    /**
      * Sets a variable in the session saying that authorization has succeeded,
      * note which userId was authorized, and note when the login took place.
      *
index c339ceb..eece8f6 100644 (file)
@@ -247,7 +247,7 @@ abstract class Horde_Auth_Base
             ? $this->_params['default_user']
             : $this->_credentials['userId'];
         $credentials = empty($this->_credentials['credentials'])
-            ? Horde_Auth::getCredential()
+            ? $GLOBALS['registry']->getAuthCredential()
             : $this->_credentials['credentials'];
 
         list($this->_credentials['userId'], $this->_credentials['credentials']) = Horde_Auth::runHook($userId, $credentials, $this->_app, 'preauthenticate', 'transparent');
index 20ea1eb..b407e7e 100644 (file)
@@ -32,8 +32,6 @@ http://pear.php.net/dtd/package-2.0.xsd">
  <license uri="http://opensource.org/licenses/lgpl-2.1.php">LGPL</license>
  <notes>* Removed Krb5 driver.
  * Moved signup code to horde/Core.
- * Add ability to retrieve app-specific credentials via
- Horde_Auth::getCredential().
  * Split Horde_Auth:: into Horde_Auth:: and Horde_Auth_Base:: components.
  * Initial Horde 4 package.
  </notes>
index 3b20f5f..d2602a6 100644 (file)
@@ -18,7 +18,7 @@ class Horde_Core_Binder_Mail implements Horde_Injector_Binder
             $params['auth'] &&
             empty($params['username'])) {
             $params['username'] = $GLOBALS['registry']->getAuth();
-            $params['password'] = Horde_Auth::getCredential('password');
+            $params['password'] = $GLOBALS['registry']->getAuthCredential('password');
         }
 
         try {
index 2ea16f0..766c501 100644 (file)
@@ -97,7 +97,7 @@ class Horde_Core_Factory_KolabStorage
         $params = array(
             'hostspec' => $session->getImapServer(),
             'username' => $GLOBALS['registry']->getAuth(),
-            'password' => Horde_Auth::getCredential('password'),
+            'password' => $GLOBALS['registry']->getAuthCredential('password'),
             'secure'   => true
         );
 
index 2f7dbbe..5faf80f 100644 (file)
@@ -1277,7 +1277,7 @@ class Horde_Registry
         } else {
             if (!isset($GLOBALS['prefs']) ||
                 ($GLOBALS['prefs']->getUser() != $this->getAuth())) {
-                $GLOBALS['prefs'] = Horde_Prefs::factory($GLOBALS['conf']['prefs']['driver'], $app, $this->getAuth(), Horde_Auth::getCredential('password'));
+                $GLOBALS['prefs'] = Horde_Prefs::factory($GLOBALS['conf']['prefs']['driver'], $app, $this->getAuth(), $this->getAuthCredential('password'));
             } else {
                 $GLOBALS['prefs']->retrieve($app);
             }
@@ -1879,4 +1879,77 @@ class Horde_Registry
         return !empty($_SESSION['horde_auth']['change']);
     }
 
+    /**
+     * Returns the requested credential for the currently logged in user, if
+     * present.
+     *
+     * @param string $credential  The credential to retrieve.
+     * @param string $app         The app to query. Defaults to Horde.
+     *
+     * @return mixed  The requested credential, all credentials if $credential
+     *                is null, or false if no user is logged in.
+     */
+    public function getAuthCredential($credential = null, $app = null)
+    {
+        if (!$this->getAuth()) {
+            return false;
+        }
+
+        $credentials = $this->_getAuthCredentials($app);
+
+        return is_null($credential)
+            ? $credentials
+            : ((is_array($credentials) && isset($credentials[$credential]))
+                   ? $credentials[$credential]
+                   : false);
+    }
+
+    /**
+     * Sets the requested credential for the currently logged in user.
+     *
+     * @param string $credential  The credential to set.
+     * @param string $value       The value to set the credential to.
+     * @param string $app         The app to update. Defaults to Horde.
+     */
+    public function setAuthCredential($credential, $value, $app = null)
+    {
+        if (!$this->getAuth()) {
+            return;
+        }
+
+        $credentials = $this->_getAuthCredentials($app);
+
+        if ($credentials !== false) {
+            if (is_array($credentials)) {
+                $credentials[$credential] = $value;
+            } else {
+                $credentials = array($credential => $value);
+            }
+
+            $secret = $GLOBALS['injector']->getInstance('Horde_Secret');
+            $_SESSION['horde_auth']['app'][$app] = $secret->write($secret->getKey('auth'), serialize($credentials));
+        }
+    }
+
+    /**
+     * Get the list of credentials for a given app.
+     *
+     * @param string $app  The application name.
+     *
+     * @return mixed  True, false, or the credential list.
+     */
+    protected function _getAuthCredentials($app)
+    {
+        if (is_null($app)) {
+            $app = $_SESSION['horde_auth']['credentials'];
+        }
+
+        if (!isset($_SESSION['horde_auth']['app'])) {
+            return false;
+        }
+
+        $secret = $GLOBALS['injector']->getInstance('Horde_Secret');
+        return @unserialize($secret->read($secret->getKey('auth'), $_SESSION['horde_auth']['app'][$app]));
+    }
+
 }
index 9a53b5c..01d1e3a 100644 (file)
@@ -195,7 +195,7 @@ class FreeBusyController extends Horde_Controller_Base
             if ($access->user == 'manager') {
                 $imapc = &Horde_Kolab_IMAP::singleton($GLOBALS['conf']['kolab']['imap']['server'],
                                                       $GLOBALS['conf']['kolab']['imap']['port']);
-                $result = $imapc->connect($access->user, Horde_Auth::getCredential('password'));
+                $result = $imapc->connect($access->user, $GLOBALS['registry']->getAuthCredential('password'));
                 if (is_a($result, 'PEAR_Error')) {
                     $reporter->failure($calendar->name, $result->getMessage());
                     continue;
index e76ddd7..c9fa356 100644 (file)
@@ -105,11 +105,11 @@ class Horde_Kolab_FreeBusy_Driver_Base
         //@todo: Fix!
         // This part allows you to use the PHP scripts with CGI rather than as
         // an apache module. This will of course slow down things but on the
-        // other hand it allows you to reduce the memory footprint of the 
-        // apache server. The default is to use PHP as a module and the CGI 
+        // other hand it allows you to reduce the memory footprint of the
+        // apache server. The default is to use PHP as a module and the CGI
         // version requires specific Apache configuration.
         //
-        // The line you need to add to your configuration of the /freebusy 
+        // The line you need to add to your configuration of the /freebusy
         // location of your server looks like this:
         //
         //    RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
@@ -160,7 +160,7 @@ class Horde_Kolab_FreeBusy_Driver_Base
                     'timestamp' => time(),
                     'remote_addr' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null,
                 );
-                Auth::setCredential('password', $pass);
+                $GLOBALS['registry']->setAuthCredential('password', $pass);
             }
     }
 
@@ -179,7 +179,7 @@ class Horde_Kolab_FreeBusy_Driver_Base
         }
 
         if (!$this->_authenticated) {
-            return PEAR::raiseError(sprintf(_("Invalid authentication for user %s!"), 
+            return PEAR::raiseError(sprintf(_("Invalid authentication for user %s!"),
                                             $this->user));
         }
         return true;
index 72c371e..295e7e8 100644 (file)
@@ -289,7 +289,7 @@ class Horde_Kolab_FreeBusy_Driver_Freebusy_Base extends Horde_Kolab_FreeBusy_Dri
                 header("Location: $redirect");
             } else {
                 header("X-Redirect-To: $redirect");
-                $redirect = 'https://' . urlencode($this->user) . ':' . urlencode(Horde_Auth::getCredential('password'))
+                $redirect = 'https://' . urlencode($this->user) . ':' . urlencode($GLOBALS['registry']->getAuthCredential('password'))
                     . '@' . $this->freebusyserver . $path;
                 if (!@readfile($redirect)) {
                     $message = sprintf(_("Unable to read free/busy information from %s"),
index 1686dc6..bb4162d 100644 (file)
@@ -101,7 +101,7 @@ class Horde_Kolab_FreeBusy_Driver_Freebusy_Kolab extends Horde_Kolab_FreeBusy_Dr
      *
      * @return boolean|PEAR_Error True if successful.
      */
-    private function _process() 
+    private function _process()
     {
         global $conf;
 
@@ -115,7 +115,7 @@ class Horde_Kolab_FreeBusy_Driver_Freebusy_Kolab extends Horde_Kolab_FreeBusy_Dr
         } else {
             $params = array(
                 'user' => $GLOBALS['registry']->getAuth(),
-                'pass' => Horde_Auth::getCredential('password'),
+                'pass' => $GLOBALS['registry']->getAuthCredential('password')
             );
         }
 
@@ -131,7 +131,7 @@ class Horde_Kolab_FreeBusy_Driver_Freebusy_Kolab extends Horde_Kolab_FreeBusy_Dr
                                  'Horde_Kolab_Server_Object_Kolab_Server');
             $this->server_object = $server;
         } catch (Horde_Kolab_Server_Exception $e) {
-            Horde::logMessage(sprintf("Failed fetching the k=kolab configuration object. Error was: %s", 
+            Horde::logMessage(sprintf("Failed fetching the k=kolab configuration object. Error was: %s",
                                       $e->getMessage()),
                               __FILE__, __LINE__, PEAR_LOG_ERR);
             $this->server_object = null;
@@ -169,7 +169,7 @@ class Horde_Kolab_FreeBusy_Driver_Freebusy_Kolab extends Horde_Kolab_FreeBusy_Dr
             $idx = strpos($this->user, '@');
             if($idx !== false) {
                 $domain = substr($this->user, $idx+1);
-                Horde::logMessage(sprintf("Trying to append %s to %s", 
+                Horde::logMessage(sprintf("Trying to append %s to %s",
                                           $domain, $this->owner),
                                   __FILE__, __LINE__, PEAR_LOG_DEBUG);
                 $odn = $odn = $db->uidForIdOrMail($this->owner . '@' . $domain);
@@ -209,7 +209,7 @@ class Horde_Kolab_FreeBusy_Driver_Freebusy_Kolab extends Horde_Kolab_FreeBusy_Dr
      *
      * @return string The IMAP folder we should access.
      */
-    function _getImapFolder() 
+    function _getImapFolder()
     {
         $userdom = false;
         $ownerdom = false;
index 7cca2f4..8533711 100644 (file)
@@ -254,9 +254,8 @@ extends Horde_Kolab_Storage_Folder_Decorator_Base
             $options = array_merge($options, $conf['http']['proxy']);
         }
 
-        require_once 'HTTP/Request.php';
         $http = new HTTP_Request($url, $options);
-        $http->setBasicAuth($GLOBALS['registry']->getAuth(), Horde_Auth::getCredential('password'));
+        $http->setBasicAuth($GLOBALS['registry']->getAuth(), $GLOBALS['registry']->getAuthCredential('password'));
         @$http->sendRequest();
         if ($http->getResponseCode() != 200) {
             return PEAR::raiseError(sprintf(_("Unable to trigger URL %s. Response: %s"),
index 1529e3c..f06c6ae 100644 (file)
@@ -14,7 +14,7 @@
  *                                array(array('jan'), array('localsql'),
  *                                      array('name', 'email')),
  *                                array('user' => $GLOBALS['registry']->getAuth(),
- *                                      'pass' => Horde_Auth::getCredential('password')));
+ *                                      'pass' => $GLOBALS['registry']->getAuthCredential('password')));
  * </code>
  *
  * Copyright 2002-2010 The Horde Project (http://www.horde.org/)
index cd457fa..3934e62 100644 (file)
@@ -39,7 +39,7 @@ class Gollem_Auth
                 $ptr = &$GLOBALS['gollem_backends'][$backend_key];
                 if (!empty($ptr['hordeauth'])) {
                     $user = Gollem::getAutologinID($backend_key);
-                    $pass = Horde_Auth::getCredential('password');
+                    $pass = $GLOBALS['registry']->getAuthCredential('password');
 
                     if (Gollem_Session::createSession($backend_key, $user, $pass)) {
                         $entry = sprintf('Login success for %s [%s] to {%s}',
index 219d9d6..4ad4317 100644 (file)
@@ -35,7 +35,7 @@ if ($vars->exists('formname')) {
     if ($form->isValid()) {
         $form->getInfo($vars, $info);
 
-        if (Horde_Auth::getCredential('password') != $info['old_password']) {
+        if ($GLOBALS['registry']->getAuthCredential('password') != $info['old_password']) {
             $notification->push(_("Old password is not correct."), 'horde.error');
         } elseif ($info['password_1'] != $info['password_2']) {
             $notification->push(_("New passwords don't match."), 'horde.error');
index 51c6c32..23aad76 100644 (file)
@@ -567,7 +567,7 @@ class IMP_Hooks
 //        // Uses the PECL ssh2 extension.
 //        $host = $_SESSION['imp']['server'];
 //        $user = $_SESSION['imp']['user'];
-//        $pass = Horde_Auth::getCredential('password');
+//        $pass = $GLOBALS['registry']->getAuthCredential('password');
 //        $command = $params[0];
 //
 //        $session = ssh2_connect($host);
index 5651e95..4dbef87 100644 (file)
@@ -306,7 +306,7 @@ class IMP_Auth
             !empty($servers[$server_key]['hordeauth'])) {
             return array(
                 'userId' => $GLOBALS['registry']->getAuth((strcasecmp($servers[$server_key]['hordeauth'], 'full') == 0) ? null : 'bare'),
-                'password' => Horde_Auth::getCredential('password'),
+                'password' => $GLOBALS['registry']->getAuthCredential('password'),
                 'server' => $server_key
             );
         }
index 71692d6..543a609 100644 (file)
@@ -348,14 +348,14 @@ class Ingo
         // Set authentication parameters.
         if (!empty($_SESSION['ingo']['backend']['hordeauth'])) {
             $params['username'] = $GLOBALS['registry']->getAuth(($_SESSION['ingo']['backend']['hordeauth'] === 'full') ? null : 'bare');
-            $params['password'] = Horde_Auth::getCredential('password');
+            $params['password'] = $GLOBALS['registry']->getAuthCredential('password');
         } elseif (isset($_SESSION['ingo']['backend']['params']['username']) &&
                   isset($_SESSION['ingo']['backend']['params']['password'])) {
             $params['username'] = $_SESSION['ingo']['backend']['params']['username'];
             $params['password'] = $_SESSION['ingo']['backend']['params']['password'];
         } else {
             $params['username'] = $GLOBALS['registry']->getAuth('bare');
-            $params['password'] = Horde_Auth::getCredential('password');
+            $params['password'] = $GLOBALS['registry']->getAuthCredential('password');
         }
 
         return Ingo_Driver::factory($_SESSION['ingo']['backend']['driver'], $params);
index 52fcefd..ebce4d3 100644 (file)
@@ -88,7 +88,7 @@ class Koward {
     {
         if (!isset(self::$server)) {
             self::$server = Horde_Kolab_Server::singleton(array('user' => $GLOBALS['registry']->getAuth(),
-                                                                'pass' => Horde_Auth::getCredential('password')));
+                                                                'pass' => $GLOBALS['registry']->getAuthCredential('password')));
         }
 
         return self::$server;
index 17f0c37..06ea750 100644 (file)
@@ -51,7 +51,7 @@ if ($form->validate($vars)) {
     exit;
 }
 
-$key = Horde_Auth::getCredential('password');
+$key = $registry->getAuthCredential('password');
 $username = $calendar['user'];
 $password = $calendar['password'];
 if ($key) {
index 63c9709..5367187 100644 (file)
@@ -349,7 +349,7 @@ class Kronolith_Application extends Horde_Registry_Application
         $calUser = trim($ui->vars->remote_user);
         $calPasswd = trim($ui->vars->remote_password);
 
-        $key = Horde_Auth::getCredential('password');
+        $key = $GLOBALS['registry']->getAuthCredential('password');
         if ($key) {
             $calUser = base64_encode(Secret::write($key, $calUser));
             $calPasswd = base64_encode(Secret::write($key, $calPasswd));
index c5f2fbf..cea6e90 100644 (file)
@@ -1878,7 +1878,7 @@ class Kronolith
         }
 
         if (strlen($info['username']) || strlen($info['password'])) {
-            $key = Horde_Auth::getCredential('password');
+            $key = $GLOBALS['registry']->getAuthCredential('password');
             if ($key) {
                 $secret = $GLOBALS['injector']->getInstance('Horde_Secret');
                 $info['username'] = base64_encode($secret->write($key, $info['username']));
@@ -2650,7 +2650,7 @@ class Kronolith
             if ($cal['url'] == $calendar) {
                 $user = isset($cal['user']) ? $cal['user'] : '';
                 $password = isset($cal['password']) ? $cal['password'] : '';
-                $key = Horde_Auth::getCredential('password');
+                $key = $GLOBALS['registry']->getAuthCredential('password');
                 if ($key && $user) {
                     $secret = $GLOBALS['injector']->getInstance('Horde_Secret');
                     $user = $secret->read($key, base64_decode($user));
index 9cd8496..249efce 100644 (file)
@@ -47,7 +47,7 @@ class Kronolith_Storage_kolab extends Kronolith_Storage
         }
 
         $http = new HTTP_Request($fb_url, $options);
-        $http->setBasicAuth($GLOBALS['registry']->getAuth(), Horde_Auth::getCredential('password'));
+        $http->setBasicAuth($GLOBALS['registry']->getAuth(), $GLOBALS['registry']->getAuthCredential('password'));
         @$http->sendRequest();
         if ($http->getResponseCode() != 200) {
             throw new Horde_Exception_NotFound();
index de00b00..7a73d06 100644 (file)
@@ -223,7 +223,7 @@ class Passwd_Driver_ldap extends Passwd_Driver {
         }
 
         // Update the stored credential within the session
-        Auth::setCredential('password', $new_password);
+        $GLOBALS['registry']->setAuthCredential('password', $new_password);
 
         return true;
     }
index a12cd82..456a2d2 100644 (file)
@@ -58,8 +58,8 @@ class Passwd {
      */
     function resetCredentials($old_password, $new_password)
     {
-        if (Auth::getCredential('password') == $old_password) {
-            Auth::setCredential('password', $new_password);
+        if ($GLOBALS['registry']->getAuthCredential('password') == $old_password) {
+            $GLOBALS['registry']->setAuthCredential('password', $new_password);
             if ($GLOBALS['registry']->getProvider() == 'imp') {
                 $_SESSION['imp']['pass'] = Secret::write(Secret::getKey('imp'),
                                                          $new_password);
index 6977eaf..bad2156 100644 (file)
@@ -439,7 +439,7 @@ $cfgSources['localsql'] = array(
 //         'tls' => false,
 //         'root' => 'ou=' . $_ldap_uid . ',ou=personal_addressbook,' . $_ldap_basedn,
 //         'bind_dn' => 'uid=' . $_ldap_uid . ',ou=People,' . $_ldap_basedn,
-//         'bind_password' => Horde_Auth::getCredential('password'),
+//         'bind_password' => $GLOBALS['registry']->getAuthCredential('password'),
 //         'dn' => array('uid'),
 //         'objectclass' => array('top',
 //                                'person',
@@ -766,7 +766,7 @@ if (!empty($GLOBALS['conf']['imsp']['enabled']) ||
     $_imsp_auth_pass = $GLOBALS['prefs']->getValue('imsp_auth_pass');
     if (!strlen($_imsp_auth_user)) {
         $_imsp_auth_user = $GLOBALS['registry']->getAuth('bare');
-        $_imsp_auth_pass = Horde_Auth::getCredential('password');
+        $_imsp_auth_pass = $GLOBALS['registry']->getAuthCredential('password');
     }
     $cfgSources['imsp'] = array(
         'title' => _("IMSP"),
index 8a4242d..4122870 100644 (file)
@@ -46,7 +46,7 @@ class Wicked_Sync {
         }
 
         if (empty($params['password'])) {
-            $params['password'] = Horde_Auth::getCredential('password');
+            $params['password'] = $GLOBALS['registry']->getAuthCredential('password');
         }
 
         if (class_exists($class)) {