Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class sfGuardUserAdminForm extends BasesfGuardUserAdminForm
- {
- /**
- * @see sfForm
- */
- public function configure()
- {
- parent::configure();
- $this->useFields(array('username'));
- //$this->setValidator('email_address', new sfValidatorString(array(
- //'max_length' => 255,
- //'required' => false
- //)));
- //On imbrique le formulaire pour personnaliser notre formulaire
- $profileForm = new UserprofilForm($this->getObject()->getUserprofil());
- unset($profileForm['id'], $profileForm['sf_guard_user_id'], $profileForm['points']);
- $this->embedForm('userprofil', $profileForm);
- //On imbrique le formulaire du profile du plugin FDA
- $forked = new sfGuardUserProfileForm($this->getObject()->getProfile());
- $forked->useFields(array('email', 'firstname', 'lastname'));
- $this->embedForm('identifiant',$forked);
- }
- }
- ############################
- Qui hérite de
- ############################
- class BasesfGuardUserAdminForm extends BasesfGuardUserForm
- {
- /**
- * @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.')));
- }
- }
Add Comment
Please, Sign In to add comment