mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fixed password emailing for edited members
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2.2@50193 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d59b8154be
commit
7429387aab
@ -413,16 +413,7 @@ class Member extends DataObject {
|
|||||||
* found update this record to merge with that member.
|
* found update this record to merge with that member.
|
||||||
*/
|
*/
|
||||||
function onBeforeWrite() {
|
function onBeforeWrite() {
|
||||||
if(isset($this->changed['Password']) && $this->changed['Password']) {
|
if($this->SetPassword) $this->Password = $this->SetPassword;
|
||||||
// Password was changed: encrypt the password according the settings
|
|
||||||
$encryption_details = Security::encrypt_password($this->Password);
|
|
||||||
$this->Password = $encryption_details['password'];
|
|
||||||
$this->Salt = $encryption_details['salt'];
|
|
||||||
$this->PasswordEncryption = $encryption_details['algorithm'];
|
|
||||||
|
|
||||||
$this->changed['Salt'] = true;
|
|
||||||
$this->changed['PasswordEncryption'] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($this->Email) {
|
if($this->Email) {
|
||||||
if($this->ID) {
|
if($this->ID) {
|
||||||
@ -450,12 +441,21 @@ class Member extends DataObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->SetPassword) $this->Password = $this->SetPassword;
|
|
||||||
|
|
||||||
if(Director::isLive() &&
|
if(Director::isLive() &&
|
||||||
$this->changed['Password'] && $this->record['Password'] &&
|
$this->changed['Password'] && $this->record['Password'] &&
|
||||||
Member::$notify_password_change) $this->sendInfo('changePassword');
|
Member::$notify_password_change) $this->sendInfo('changePassword');
|
||||||
|
|
||||||
|
if(isset($this->changed['Password']) && $this->changed['Password']) {
|
||||||
|
// Password was changed: encrypt the password according the settings
|
||||||
|
$encryption_details = Security::encrypt_password($this->Password);
|
||||||
|
$this->Password = $encryption_details['password'];
|
||||||
|
$this->Salt = $encryption_details['salt'];
|
||||||
|
$this->PasswordEncryption = $encryption_details['algorithm'];
|
||||||
|
|
||||||
|
$this->changed['Salt'] = true;
|
||||||
|
$this->changed['PasswordEncryption'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
parent::onBeforeWrite();
|
parent::onBeforeWrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user