I use Doctrine:
User:
columns:
username: { type: string(255), unique: true }
password: { type: string(255) }
ip: { type: string(255) }
This generated me new form:
username:
password:
ip:
How can i make confirm password and get the IP address in hidden input?
I will:
username:
password:
confirm password:
and in mysql database will username, password and IP ($_SERVER[‘REMOTE_ADDR’];)
How can i it make in Symfony 1.4?
THX!
@@@@@@@
added:
i make:
$user = $this->form->getObject();
$user->setPassword(sha1($user->getPassword()));
$user->setIp($_SERVER['REMOTE_ADDR']);
$user = $form->save();
setPassword doesn’t work, but setIp good work.
You may remove fields by setting in the configure() method of your form:
And add a confirm password field by:
You may add the ip in your actions.class.php:
A small note: I strongly recommend using the existing plugins (doAuth / sfDoctrineGuardPlugin) if you’re planning to do this kind of work.