From: Duck Date: Tue, 3 Nov 2009 18:44:24 +0000 (-0700) Subject: Ticket #8667: Add resetPassword() to Horde_Auth_Application::. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0e5e47213037c15cd4761a5bb571a77a6eac71d8;p=horde.git Ticket #8667: Add resetPassword() to Horde_Auth_Application::. Signed-off-by: Michael M Slusarz --- diff --git a/framework/Auth/lib/Horde/Auth/Application.php b/framework/Auth/lib/Horde/Auth/Application.php index 7b7eb4723..5d472de60 100644 --- a/framework/Auth/lib/Horde/Auth/Application.php +++ b/framework/Auth/lib/Horde/Auth/Application.php @@ -39,6 +39,7 @@ class Horde_Auth_Application extends Horde_Auth_Base 'list' => 'authUserList', 'loginparams' => 'authLoginParams', 'remove' => 'authRemoveUser', + 'resetpassword' => 'authResetPassword', 'transparent' => 'authTransparent', 'update' => 'authUpdateUser' ); @@ -199,6 +200,25 @@ class Horde_Auth_Application extends Horde_Auth_Base } /** + * Reset a user's password. Used for example when the user does not + * remember the existing password. + * + * @param string $userId The userId for which to reset the password. + * + * @return string The new password on success. + * @throws Horde_Auth_Exception + */ + public function resetPassword($userId) + { + if ($this->hasCapability('resetpassword')) { + $registry = Horde_Registry::singleton(); + return $registry->callAppMethod($this->_app, $this->_apiMethods['resetpassword'], array('args' => array($userId))); + } + + return parent::resetPassword(); + } + + /** * Delete a set of authentication credentials. * * @param string $userId The userId to delete.