src/Security/Member.php
public function changePassword($password, $write = true)
    {
        $this->Password = $password;
        $valid = $this->validate();

        $this->extend('onBeforeChangePassword', $password, $valid);

        if ($valid->isValid()) {
            $this->AutoLoginHash = null;

            $this->encryptPassword();

            if ($write) {
                $this->passwordChangesToWrite = true;
                $this->write();
            }
        }

        $this->extend('onAfterChangePassword', $password, $valid);

        return $valid;
    }
public function changePassword($password, $write = true)
    {
        $this->Password = $password;
        $valid = $this->validate();

        $this->extend('onBeforeChangePassword', $password, $valid);

        if ($valid->isValid()) {
            $this->AutoLoginHash = null;

            $this->encryptPassword();

            if ($write) {
                $this->passwordChangesToWrite = true;
                $this->write();
            }
        }

        $this->extend('onAfterChangePassword', $password, $valid);

        return $valid;
    }
public function changePassword ( $ password , $ write = true ) { $ this -> Password = $ password ; $ valid = $ this -> validate ( ) ; $ this -> extend ( 'onBeforeChangePassword' , $ password , $ valid ) ; if ( $ valid -> isValid ( ) ) { $ this -> AutoLoginHash = null ; $ this -> encryptPassword ( ) ; if ( $ write ) { $ this -> passwordChangesToWrite = true ; $ this -> write ( ) ; } } $ this -> extend ( 'onAfterChangePassword' , $ password , $ valid ) ; return $ valid ; }
Change password. This will cause rehashing according to the `PasswordEncryption` property. This method will
allow extensions to perform actions and augment the validation result if required before the password is written
and can check it after the write also.

This method will encrypt the password prior to writing.

@param string $password Cleartext password
@param bool $write Whether to write the member afterwards
@return ValidationResult
Change password . This will cause rehashing according to the PasswordEncryption property . This method will allow extensions to perform actions and augment the validation result if required before the password is written and can check it after the write also .