d82c0567320a89b501a774f3a528456257050740
[mobi/.git] /
1 <?php
2
3 /**
4  * BasesfGuardChangeUserPasswordForm for changing a users password
5  *
6  * @package    sfDoctrineGuardPlugin
7  * @subpackage form
8  * @author     Jonathan H. Wage <jonwage@gmail.com>
9  * @version    SVN: $Id: BasesfGuardChangeUserPasswordForm.class.php 23536 2009-11-02 21:41:21Z Kris.Wallsmith $
10  */
11 class BasesfGuardChangeUserPasswordForm extends BasesfGuardUserForm
12 {
13   public function setup()
14   {
15     parent::setup();
16
17     $this->useFields(array('password'));
18
19     $this->widgetSchema['password'] = new sfWidgetFormInputPassword();
20     $this->validatorSchema['password']->setOption('required', true);
21     $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword();
22     $this->validatorSchema['password_again'] = clone $this->validatorSchema['password'];
23     $this->validatorSchema['password_again']->setOption('required', true);
24
25     $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.')));
26   }
27 }