src/models/UserChangePassword.php
public function checkAndStore()
    {
        if (!$this->user->validatePassword($this->oldpass)) {
            return $this->addError('oldpass', 'The previous old password is invalid.');
        }
        
        if (!$this->user->changePassword($this->newpass)) {
            return $this->addErrors($this->user->getErrors());
        }
    }
public function checkAndStore()
    {
        if (!$this->user->validatePassword($this->oldpass)) {
            return $this->addError('oldpass', 'The previous old password is invalid.');
        }
        
        if (!$this->user->changePassword($this->newpass)) {
            return $this->addErrors($this->user->getErrors());
        }
    }
public function checkAndStore ( ) { if ( ! $ this -> user -> validatePassword ( $ this -> oldpass ) ) { return $ this -> addError ( 'oldpass' , 'The previous old password is invalid.' ) ; } if ( ! $ this -> user -> changePassword ( $ this -> newpass ) ) { return $ this -> addErrors ( $ this -> user -> getErrors ( ) ) ; } }
Checks if the password is valid and stores the new password.

@return boolean
Checks if the password is valid and stores the new password .