ChangeRPasswordForm.class.php 905 Bytes
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
class ChangeRPasswordForm extends BaseRegisterUserForm 
{
  public function configure()
  {
    $this->useFields(array('password'));
    
    $this->widgetSchema['password'] = new sfWidgetFormInputPassword(array('label' => 'Пароль'), array('size' => 30, 'autocomplete' => 'off'));
    $this->widgetSchema['confirm_password'] = new sfWidgetFormInputPassword(array('label' => 'Подтвердите новый пароль'), array('size' => 30, 'autocomplete' => 'off'));
    
    $this->validatorSchema['password'] = new sfValidatorAnd(array(
      $this->validatorSchema['password'],
      new sfValidatorRegex(array('pattern' => '/[!@#$%^&*()+:;,.-_a-zA-Z0-9]{6,20}/'), array('invalid' => 'Слишком простой пароль'))
    ));
    $this->validatorSchema['confirm_password'] = new sfValidatorPass();
    $this->widgetSchema->setNameFormat('user_password[%s]');
    
  }
}
?>