Ticket #8667: Add resetPassword() to Horde_Auth_Application::.
authorDuck <duck@obala.net>
Tue, 3 Nov 2009 18:44:24 +0000 (11:44 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 3 Nov 2009 18:45:12 +0000 (11:45 -0700)
Signed-off-by: Michael M Slusarz <slusarz@curecanti.org>
framework/Auth/lib/Horde/Auth/Application.php

index 7b7eb47..5d472de 100644 (file)
@@ -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.