ResetPasswordUserForm.class.php 690 Bytes
Newer Older
Игорь's avatar
init    
Игорь committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
class ResetPasswordUserForm extends BaseResetPasswordForm {
    public function configure()
    {
        parent::configure();

        $this->widgetSchema['email'] = new sfWidgetFormInputText(array(), array('required' => 'required', 'placeholder' => 'Эл. почта', 'size' => 24));
        
        $q = Doctrine_Query::create()
            ->from("User")
            ->where("is_super_admin = 1")
            ->andWhere("username <> ?", 'root')
        ;
        $this->setValidators(array(
            'email' => new sfValidatorAnd(array(new sfValidatorEmail(), new sfValidatorDoctrineChoice(array('query' => $q, 'model'=> 'User','column' => 'email'))))
        ));
    }
}
?>