Sorry....
This story has to be continued....
Class User
{
public function setPassword($password)
{
$this->salt = md5(time());
$encoder = new MessageDigestPasswordEncoder('sha512', true, 10);
$this->password = $encoder->encodePassword($password, $this->getSalt());
}
}
That should work [?]
2011/5/30 oscar balladares <[email protected]>
> [?] Ok, I got your point.
>
> Of course, it is up to the developer to remember everything, and debug any
> issue during the life cicle of the app. If not then he/she
> wouldn't be a developer.
>
> But I'm pretty sure that you mean that you want more abstraction. You
> could:
>
> <?php
>
> namespace bla\bla\Entity;
> use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
>
> Class User
> {
>
> public function setPassword($password)
> {
> $this->salt = md5(time());
> }
>
> }
>
> 2011/5/30 Vincent Lechemin <[email protected]>
>
>> Ops, the forced parameter in the constructor is not a good idea for an
>> entity :p
>>
>> --
>> Vincent
>> On May 30, 2011 9:29 AM, "Vincent Lechemin" <[email protected]>
>> wrote:
>> > Hi,
>> > you could use doctrine events such as preUpdate and prePersist. Then
>> adding
>> > the encoder service in the constructor could be a way to enforce the
>> > encryption. For the fixtures, you have access to the container so it
>> should
>> > not be a problem.
>> >
>> > --
>> > Vincent
>>
>> --
>> If you want to report a vulnerability issue on symfony, please send it to
>> security at symfony-project.com
>>
>> You received this message because you are subscribed to the Google
>> Groups "symfony users" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-users?hl=en
>>
>
>
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
<<338.gif>>
<<364.gif>>
