Source for file password.php

Documentation is available at password.php

  1. <?php
  2. /**
  3. * Permit a local user to change their password
  4. *
  5. @author    Stuart Prescott
  6. @copyright  Copyright Stuart Prescott
  7. @license    http://opensource.org/licenses/gpl-license.php GNU Public License
  8. @version    $Id$
  9. @package    Bumblebee
  10. @subpackage Actions
  11. *
  12. *  path (bumblebee root)/inc/actions/password.php
  13. */
  14.  
  15. /** Load ancillary functions */
  16. require_once 'inc/typeinfo.php';
  17.  
  18. /** parent object */
  19. require_once 'inc/actions/actionaction.php';
  20. /** user editing object */
  21. require_once 'inc/bb/user.php';
  22.  
  23. /**
  24. * Permit a local user to change their password
  25. *
  26. @package    Bumblebee
  27. @subpackage Actions
  28. @todo //TODO: extend form to include current password for auth
  29. */
  30. class ActionPassword extends ActionAction {
  31.  
  32.   /**
  33.   * Initialising the class
  34.   *
  35.   * @param  BumblebeeAuth $auth  Authorisation object
  36.   * @param  array $pdata   extra state data from the call path
  37.   * @return void nothing
  38.   */
  39.   function ActionPassword($auth$pdata{
  40.     parent::ActionAction($auth$pdata);
  41.     $this->mungeInputData();
  42.   }
  43.  
  44.   function go({
  45.     if ($this->readOnly$this->_dataCleanse('id');
  46.     $this->edit();
  47.     echo "<br /><br /><a href='".makeURL('')."'>".T_('Return to main menu')."</a>";
  48.   }
  49.  
  50.   function edit({
  51.     $user new User($this->auth$this->auth->uidtrue);
  52.     $user->update($this->PD);
  53.     #$project->fields['defaultclass']->invalid = 1;
  54.     $user->checkValid();
  55.     echo $this->reportAction($user->sync(),
  56.           array(
  57.               STATUS_OK =>   T_('Password changed successfully.'),
  58.               STATUS_ERR =>  T_('Password could not be changed: ').$user->errorMessage
  59.           )
  60.         );
  61.     echo $user->display();
  62.     echo "<input type='submit' name='submit' value='".T_('Change password')."' />";
  63.   }
  64. }
  65.  
  66. ?>

Documentation generated on Tue, 06 Mar 2007 10:01:48 +0000 by phpDocumentor 1.3.0