public function checkPassword($user, $newPassword, $confirmationPassword, $shouldCheckPasswordLength = false)
    {
        //  no password at all
        if ($shouldCheckPasswordLength && getStr()->strlen($newPassword) == 0) {
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class);
            $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_INPUT_EMPTYPASS'));

            return $this->addValidationError("oxuser__oxpassword", $exception);
        }

        if ($shouldCheckPasswordLength && getStr()->strlen($newPassword) < $this->getPasswordLength()) {
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\InputException::class);
            $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_TOO_SHORT'));

            return $this->addValidationError("oxuser__oxpassword", $exception);
        }

        //  passwords do not match ?
        if ($newPassword != $confirmationPassword) {
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\UserException::class);
            $exception->setMessage(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('ERROR_MESSAGE_PASSWORD_DO_NOT_MATCH'));

            return $this->addValidationError("oxuser__oxpassword", $exception);
        }
    }