From: Michael M Slusarz Date: Tue, 8 Jun 2010 19:28:16 +0000 (-0600) Subject: Move setCredential() and getCredential() to horde/Core X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=bb5a553250e937a8e82ecfbd57fd99cc9d777c27;p=horde.git Move setCredential() and getCredential() to horde/Core Rename to setAuthCredential() and getAuthCredential() to map getAuth()/setAuth() and to distinguish from Horde_Auth_Base's [set|get]Credential(). --- diff --git a/folks/edit/password.php b/folks/edit/password.php index d27d94d12..97f7714b1 100644 --- a/folks/edit/password.php +++ b/folks/edit/password.php @@ -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'])) { diff --git a/framework/Auth/lib/Horde/Auth.php b/framework/Auth/lib/Horde/Auth.php index f58e6d151..c182650e2 100644 --- a/framework/Auth/lib/Horde/Auth.php +++ b/framework/Auth/lib/Horde/Auth.php @@ -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. * diff --git a/framework/Auth/lib/Horde/Auth/Base.php b/framework/Auth/lib/Horde/Auth/Base.php index c339cebdf..eece8f6c0 100644 --- a/framework/Auth/lib/Horde/Auth/Base.php +++ b/framework/Auth/lib/Horde/Auth/Base.php @@ -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'); diff --git a/framework/Auth/package.xml b/framework/Auth/package.xml index 20ea1eb36..b407e7ea1 100644 --- a/framework/Auth/package.xml +++ b/framework/Auth/package.xml @@ -32,8 +32,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> LGPL * 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. diff --git a/framework/Core/lib/Horde/Core/Binder/Mail.php b/framework/Core/lib/Horde/Core/Binder/Mail.php index 3b20f5f8d..d2602a6a7 100644 --- a/framework/Core/lib/Horde/Core/Binder/Mail.php +++ b/framework/Core/lib/Horde/Core/Binder/Mail.php @@ -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 { diff --git a/framework/Core/lib/Horde/Core/Factory/KolabStorage.php b/framework/Core/lib/Horde/Core/Factory/KolabStorage.php index 2ea16f066..766c50193 100644 --- a/framework/Core/lib/Horde/Core/Factory/KolabStorage.php +++ b/framework/Core/lib/Horde/Core/Factory/KolabStorage.php @@ -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 ); diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 2f7dbbeee..5faf80fcb 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -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])); + } + } diff --git a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Controller/FreebusyController.php b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Controller/FreebusyController.php index 9a53b5c3a..01d1e3a04 100644 --- a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Controller/FreebusyController.php +++ b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Controller/FreebusyController.php @@ -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; diff --git a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Base.php b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Base.php index e76ddd79b..c9fa3562e 100644 --- a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Base.php +++ b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Base.php @@ -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; diff --git a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Base.php b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Base.php index 72c371e92..295e7e885 100644 --- a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Base.php +++ b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Base.php @@ -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"), diff --git a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Kolab.php b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Kolab.php index 1686dc619..bb4162dbd 100644 --- a/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Kolab.php +++ b/framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Driver/Freebusy/Kolab.php @@ -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; diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php index 7cca2f490..853371170 100644 --- a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php +++ b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Folder/Decorator/Trigger.php @@ -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"), diff --git a/framework/Rpc/lib/Horde/Rpc.php b/framework/Rpc/lib/Horde/Rpc.php index 1529e3c2a..f06c6ae91 100644 --- a/framework/Rpc/lib/Horde/Rpc.php +++ b/framework/Rpc/lib/Horde/Rpc.php @@ -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'))); * * * Copyright 2002-2010 The Horde Project (http://www.horde.org/) diff --git a/gollem/lib/Auth.php b/gollem/lib/Auth.php index cd457fa53..3934e626e 100644 --- a/gollem/lib/Auth.php +++ b/gollem/lib/Auth.php @@ -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}', diff --git a/horde/services/changepassword.php b/horde/services/changepassword.php index 219d9d677..4ad4317a0 100644 --- a/horde/services/changepassword.php +++ b/horde/services/changepassword.php @@ -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'); diff --git a/imp/config/hooks.php.dist b/imp/config/hooks.php.dist index 51c6c3241..23aad7651 100644 --- a/imp/config/hooks.php.dist +++ b/imp/config/hooks.php.dist @@ -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); diff --git a/imp/lib/Auth.php b/imp/lib/Auth.php index 5651e95ed..4dbef871f 100644 --- a/imp/lib/Auth.php +++ b/imp/lib/Auth.php @@ -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 ); } diff --git a/ingo/lib/Ingo.php b/ingo/lib/Ingo.php index 71692d618..543a60999 100644 --- a/ingo/lib/Ingo.php +++ b/ingo/lib/Ingo.php @@ -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); diff --git a/koward/lib/Koward.php b/koward/lib/Koward.php index 52fcefdd7..ebce4d385 100644 --- a/koward/lib/Koward.php +++ b/koward/lib/Koward.php @@ -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; diff --git a/kronolith/calendars/remote_edit.php b/kronolith/calendars/remote_edit.php index 17f0c3797..06ea750d8 100644 --- a/kronolith/calendars/remote_edit.php +++ b/kronolith/calendars/remote_edit.php @@ -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) { diff --git a/kronolith/lib/Application.php b/kronolith/lib/Application.php index 63c970906..536718770 100644 --- a/kronolith/lib/Application.php +++ b/kronolith/lib/Application.php @@ -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)); diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index c5f2fbf8d..cea6e90e9 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -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)); diff --git a/kronolith/lib/Storage/kolab.php b/kronolith/lib/Storage/kolab.php index 9cd8496e6..249efce8a 100644 --- a/kronolith/lib/Storage/kolab.php +++ b/kronolith/lib/Storage/kolab.php @@ -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(); diff --git a/passwd/lib/Driver/ldap.php b/passwd/lib/Driver/ldap.php index de00b005e..7a73d0698 100644 --- a/passwd/lib/Driver/ldap.php +++ b/passwd/lib/Driver/ldap.php @@ -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; } diff --git a/passwd/lib/Passwd.php b/passwd/lib/Passwd.php index a12cd8275..456a2d2fc 100644 --- a/passwd/lib/Passwd.php +++ b/passwd/lib/Passwd.php @@ -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); diff --git a/turba/config/sources.php.dist b/turba/config/sources.php.dist index 6977eafe3..bad2156ae 100644 --- a/turba/config/sources.php.dist +++ b/turba/config/sources.php.dist @@ -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"), diff --git a/wicked/lib/Sync.php b/wicked/lib/Sync.php index 8a4242d21..412287099 100644 --- a/wicked/lib/Sync.php +++ b/wicked/lib/Sync.php @@ -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)) {