/** * @see sfForm */ public function setup() { parent::setup(); $this->widgetSchema['email_address'] = new sfWidgetFormInputEmail(array(), array('placeholder' => '*****@*****.**')); $this->widgetSchema['username'] = new sfWidgetFormInputText(array(), array('placeholder' => 'nocoolnametom')); $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->widgetSchema['full_name'] = new sfWidgetFormInputText(array(), array('placeholder' => 'First and last name')); $this->widgetSchema['preferred_name'] = new sfWidgetFormInputText(array(), array('placeholder' => 'Bob?')); $this->widgetSchema['website'] = new sfWidgetFormInputUrl(array(), array('placeholder' => 'http://nocoolnametom.com/')); $this->widgetSchema['twitter_account'] = new sfWidgetFormInputText(array(), array('placeholder' => '@NoCoolName_Tom')); $this->widgetSchema['avatar'] = new sfWidgetFormInputUrl(); $this->widgetSchema['short_bio'] = new sfWidgetFormTextarea(array(), array('placeholder' => 'A bit about yourself...')); $this->widgetSchema['address_line_one'] = new sfWidgetFormInputText(); $this->widgetSchema['address_line_two'] = new sfWidgetFormInputText(); $this->widgetSchema['city'] = new sfWidgetFormInputText(); $this->widgetSchema['state'] = new sfWidgetFormSelectUSState(); $this->widgetSchema['zip_code'] = new sfWidgetFormInputText(); $this->widgetSchema['country'] = new sfWidgetFormI18nChoiceCountry(array('add_empty' => true)); $this->widgetSchema['preferred_language'] = new sfWidgetFormI18nChoiceLanguage(); $this->validatorSchema['country'] = new sfValidatorI18nChoiceCountry(); $this->validatorSchema['preferred_language'] = new sfValidatorI18nChoiceLanguage(); unset($this['last_login'], $this['created_at'], $this['updated_at'], $this['salt'], $this['algorithm']); $this->widgetSchema['groups_list']->setLabel('Groups'); $this->widgetSchema['permissions_list']->setLabel('Permissions'); $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password']->setOption('required', false); $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password_again'] = clone $this->validatorSchema['password']; $this->widgetSchema->moveField('password_again', 'after', 'password'); $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.'))); }
public function configure() { parent::setup(); if ($this->isNew()) { $this->embedForm('Files', new filesForm()); } else { $this->embedRelation('Files'); } $this->embedRelation('Profile'); unset($this['last_login'], $this['created_at'], $this['updated_at'], $this['salt'], $this['algorithm'], $this['is_active'], $this['is_super_admin'], $this['groups_list'], $this['permissions_list'], $this['evaluations_list'], $this['username'], $this['email'], $this['Files']); }
public function setup() { parent::setup(); $this->useFields(array('password')); $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password']->setOption('required', true); $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password_again'] = clone $this->validatorSchema['password']; $this->validatorSchema['password_again']->setOption('required', true); $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.'))); }
/** * @see sfForm */ public function setup() { parent::setup(); unset($this['last_login'], $this['created_at'], $this['updated_at'], $this['salt'], $this['algorithm']); $this->widgetSchema['groups_list']->setLabel('Groups'); $this->widgetSchema['permissions_list']->setLabel('Permissions'); $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password']->setOption('required', false); $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password_again'] = clone $this->validatorSchema['password']; $this->widgetSchema->moveField('password_again', 'after', 'password'); $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.'))); }
public function setup() { parent::setup(); $this->useFields(array('password')); if (true === sfConfig::get('app_sf_guard_user_pssword_hard', true)) { $this->validatorSchema['password'] = new sfValidatorRegex(array('pattern' => '/^(?=.*\\d)(?=.*[a-zA-Z]).{8,}$/')); $this->validatorSchema['password']->setMessage('invalid', 'A jelszó minimum 8 karakteres, és legalább 1 számot és egy nagy betűt tartalmaz!'); } $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password']->setOption('required', true); $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password_again'] = clone $this->validatorSchema['password']; $this->validatorSchema['password_again']->setOption('required', true); $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.'))); $this->getWidgetSchema()->getFormFormatter()->setTranslationCatalogue('sf_guard'); }
/** * @see sfForm */ public function setup() { parent::setup(); unset($this['last_login'], $this['created_at'], $this['updated_at'], $this['salt'], $this['algorithm']); $this->widgetSchema['groups_list']->setLabel('Groups'); $this->widgetSchema['permissions_list']->setLabel('Permissions'); $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); if (sfConfig::get('app_sf_guard_plugin_hard_pasword', true) == true) { $this->validatorSchema['password'] = new sfValidatorRegex(array('pattern' => '/^(?=.*\\d)(?=.*[a-zA-Z]).{8,}$/')); $this->validatorSchema['password']->setMessage('invalid', 'A jelszó minimum 8 karakteres, és legalább 1 számot és egy nagy betűt tartalmaz!'); } $this->validatorSchema['password']->setOption('required', false); $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password_again'] = clone $this->validatorSchema['password']; $this->widgetSchema->moveField('password_again', 'after', 'password'); $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.'))); }
public function configure() { parent::setup(); if ($this->isNew()) { $this->embedForm('Files', new filesForm()); } else { $this->embedRelation('Files'); } unset($this['last_login'], $this['created_at'], $this['updated_at'], $this['salt'], $this['algorithm'], $this['is_active'], $this['is_super_admin'], $this['groups_list'], $this['permissions_list'], $this['evaluations_list']); $this->widgetSchema['password'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password']->setOption('required', true); $this->widgetSchema['password_again'] = new sfWidgetFormInputPassword(); $this->validatorSchema['password_again'] = clone $this->validatorSchema['password']; $this->widgetSchema->moveField('password_again', 'after', 'password'); $this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'password_again', array(), array('invalid' => 'The two passwords must be the same.'))); $this->widgetSchema->setLabels(array('username' => 'Usuario', 'password' => 'Contraseña', 'password_again' => 'Repita el password')); $this->embedRelation('Profile'); }