<?php
class CustomRegisterUserForm extends PluginUserForm {

  public function configure()
  {
    $this->setWidget('password',  new sfWidgetFormInputPassword());
    $this->setWidget('repeat_password',  new sfWidgetFormInputPassword());

    $this->setValidators(array(
      'id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'username' => new sfValidatorString(array('required'=> true)),
      'email' => new sfValidatorEmail(array('required'=> true)),
      'password' => new sfValidatorString(array('required'=> true)),
      'organization' => new sfValidatorString(array('required'=> false)),
      'address' => new sfValidatorString(array('required'=> false)),
      'phone_number' => new sfValidatorString(array('required'=> false)),
      'city' => new sfValidatorString(array('required'=> false)),
      'is_active' => new sfValidatorString(array('required'=> false)),
     
    ));

    unset($this['id'],$this['is_super_admin'],$this['last_login'],$this['created_at'],$this['updated_at']);
/*
    $this->validatorSchema->setPostValidator(new sfValidatorAnd(array(
      new sfValidatorSchemaCompare('password', '==', 'repeat_password'),
    )));*/
    $this->disableCSRFProtection();
    
    $this->useFields(array('organization', 'username', 'city', 'address', 'phone_number', 'email', 'password','is_active'));
  }
}

?>