edit sfForkedDoctrineApplyPlugin user/settings
I wan't to edit the user/settings page made by s开发者_StackOverflow中文版fForkedDoctrineApplyPlugin. I couldn't find anything useful. Or is there a way to completely disable user/settings and use the methods for setting a new mailaddress with a custom profile page?
edit: Currently the user/settings form of sfForkedDoctrineApplyPlugin only allows me to modify the first and last name. I wan't to edit this, or create (which I prefer) my own custom user settings page and use the methods for changing email addresses, that are already build-in sfForkedDoctrineApplyPlugin.
check file: sfApplySettingsForm.class.php there is:
class sfApplySettingsForm extends sfGuardUserProfileForm
{
public function configure()
{
parent::configure();
$this->removeFields();
// We're editing the user who is logged in. It is not appropriate
// for the user to get to pick somebody else's userid, or change
// the validate field which is part of how their account is
// verified by email. Also, users cannot change their email
// addresses as they are our only verified connection to the user.
$this->widgetSchema->setLabels(
array(
'firstname' => 'First Name',
'lastname' => 'Last name') );
$this->widgetSchema->moveField('firstname', sfWidgetFormSchema::FIRST);
$this->widgetSchema->moveField('lastname', sfWidgetFormSchema::AFTER, 'firstname');
$this->widgetSchema->setNameFormat('sfApplySettings[%s]');
$this->widgetSchema->setFormFormatterName('list');
$this->setValidator( 'firstname' , new sfValidatorApplyFirstname() );
$this->setValidator( 'lastname', new sfValidatorApplyLastname() );
}
protected function removeFields()
{
unset(
$this['user_id'],
$this['validate'],
$this['email'],
$this['email_new'],
$this['validate_at'],
$this['id'],
$this['created_at'],
$this['updated_at']
);
}
}
精彩评论