I am building a website with member area and management. With a ModelAdmin for the member object (extending Member) and a registration form on the front end. All the creation and manipulation of the data works fine on both ends.
But just recently I have noticed that when creating a new member through ModelAdmin, the password is not encrypted.
However, encryption is made when registering through the front end form, or changing an already encrypted password through ModelAdmin.
I have tried adding this in the onBeforeWrite of my member object:
if ( $this->isChanged('Password') )
$encryptedPass = Security::encrypt_password($this->Password);
$this->Password = $encryptedPass['password'];
$this->PasswordEncryption = $encryptedPass['algorithm'];
$this->Salt = $encryptedPass['salt'];
This does encrypt the password, but probably in a wrong way or something, because there is no way to login anymore with that password.
If there some configuration option to set for ModelAdmin to encrypt password as a default?
Any help much appreciated.
(using SS 2.4 rc1)