I am developing a new application using Symfony. I want to save hashed passwords, so I redefined the save method in my User model:
public function save(Doctrine_Connection $conn = null)
{
$this->setUserPassword( md5($this->getUserPassword()) );
return parent::save($conn);
}
This works well when creating a new user. However, this causes problems when editing the user without changing his password. This forces Doctrine to hash the password already hashed.
So, I need to check if UserPassword is being changed in the DoctrineRecord instance. How can i do this?
source
share