public function updateObject($values = null) { $object = parent::updateObject($values); $object->setUserId($this->userId); $object->setValidate($this->validate); // Don't break subclasses! return $object; }
public function configure() { parent::configure(); // We're editing the user who is logged in. It is not appropriate // for the user to get tsfApplySettingsForm.classo 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. }
public function setup() { parent::setup(); // Allowing a user to associate their profile with another // user's id does not make sense unset($this['user_id']); $this->widgetSchema->setNameFormat('settings[%s]'); $this->widgetSchema->setFormFormatterName('list'); $this->widgetSchema->getFormFormatter()->setTranslationCatalogue('apostrophe'); }
public function doSave($con = null) { $user = new sfGuardUser(); $user->setUsername($this->getValue('username')); $user->setPassword($this->getValue('password')); $user->setEmailAddress($this->getValue('email')); // They must confirm their account first $user->setIsActive(false); $user->save(); $this->getObject()->setUserId($user->getId()); return parent::doSave($con); }
public function configure() { parent::configure(); // 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. unset($this['user_id'], $this['validate'], $this['email']); $this->widgetSchema->setNameFormat('sfApplySettings[%s]'); $this->widgetSchema->setFormFormatterName('list'); $this->widgetSchema->setLabels(array('fullname' => 'Full Name')); }
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 setupInheritance() { parent::setupInheritance(); $this->widgetSchema->setNameFormat('my_profile[%s]'); }