[geeklog-cvs] Auth_Enterprise/Server/providers AEPearDBProvider.class.php,1.2,1.3

tony at iowaoutdoors.org tony at iowaoutdoors.org
Thu Jun 17 01:33:53 EDT 2004


Update of /var/cvs/Auth_Enterprise/Server/providers
In directory www:/tmp/cvs-serv6404

Modified Files:
	AEPearDBProvider.class.php 
Log Message:
Added resetPassword

Index: AEPearDBProvider.class.php
===================================================================
RCS file: /var/cvs/Auth_Enterprise/Server/providers/AEPearDBProvider.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** AEPearDBProvider.class.php	16 Jun 2004 05:24:30 -0000	1.2
--- AEPearDBProvider.class.php	17 Jun 2004 05:33:51 -0000	1.3
***************
*** 205,209 ****
      * @param string $userName User for whom to change the password for
      * @param string $newPassword The user's new password.
!     * @todo need to add the rollback
      * 
      */
--- 205,209 ----
      * @param string $userName User for whom to change the password for
      * @param string $newPassword The user's new password.
!     * @todo need to add ability to limit a certain number of password changes within 24 hours.
      * 
      */
***************
*** 211,215 ****
      {
          // Make sure new password is a valid format
!         if (!$this->passwordIsValid($newPassword)) {
              throw new AEPasswordInvalid();
          }
--- 211,215 ----
      {
          // Make sure new password is a valid format
!         if (!AEPasswordGenerator::isValidPassword($newPassword)) {
              throw new AEPasswordInvalid();
          }
***************
*** 339,342 ****
--- 339,363 ----
      
      /**
+     * Gives the user a randomly generator password
+     *
+     * @author Tony Bibbs <tony at geeklog.net>
+     * @access public
+     * @param string $userName User to reset password for
+     * @return string New password
+     *
+     */
+     public function resetPassword($userName)
+     {
+         $newPassword = AEPasswordGenerator::generatePassword();
+         
+         try {
+             // Now reuse what we did in changePassword();
+             return $this->changePassword($userName, $newPassword);
+         } catch (Exception $e) {
+             throw $e;
+         }
+     }
+     
+     /**
      * Atomic function that only does password change
      *




More information about the geeklog-cvs mailing list