Created
February 17, 2009 18:08
-
-
Save donut/65868 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* sfGuardUser form. | |
* | |
* @package form | |
* @subpackage sfGuardUser | |
* @version SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $ | |
*/ | |
class sfGuardUserForm extends PluginsfGuardUserForm | |
{ | |
public function configure () { | |
unset($this['algorithm'], $this['is_active'], $this['is_super_admin'], $this['salt'], | |
$this['last_login'], $this['created_at'], $this['updated_at']); | |
$this->embedForm('sfGuardUserProfile', new sfGuardUserProfileForm($this->getObject()->profile())); | |
$this->widgetSchema['username']->setAttribute('class', 'text'); | |
$this->setWidget('password', new sfWidgetFormInputPassword(array(), array('class' => 'text'))); | |
$this->setWidget('confirm_password', new sfWidgetFormInputPassword(array(), array('class' => 'text'))); | |
$this->setValidator('password', new sfValidatorString(array('max_length' => 128))); | |
if (!$this->isNew()) | |
$this->validatorSchema['password']->setOption('required', false); | |
$this->validatorSchema['confirm_password'] = clone $this->validatorSchema['password']; | |
$this->widgetSchema->moveField('confirm_password', 'after', 'password'); | |
$this->mergePostValidator(new sfValidatorSchemaCompare('password', sfValidatorSchemaCompare::EQUAL, 'confirm_password', | |
array(), array('invalid' => 'Passwords do not match.'))); | |
} | |
// protected function doSave ($con = null) { | |
// parent::doSave($con); | |
// | |
// echo "PING!"; | |
//set user for profile object | |
// $user = $this->getObject(); | |
// $embedded_forms = $this->getEmbeddedForms(); | |
// $profile = $embedded_forms['profile']->getObject(); | |
// if ($profile->getUserId() != $user->getId()) { | |
// $profile->setUserId($user->getId()); | |
// $profile->save(); } | |
// } | |
// public function updateObject ($values = null) | |
// { | |
// $object = parent::updateObject($values); | |
// $this->getObject()->profile()->setUserId($this->getObject()->getId()); | |
// return $object; | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment