source/Core/InputValidator.php
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);
        }
    }
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);
        }
    }
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 ) ; } }
Checking if user password is fine. In case of error
exception is thrown

@param User   $user                      Active user.
@param string $newPassword               New user password.
@param string $confirmationPassword      Retyped user password.
@param bool   $shouldCheckPasswordLength Option to check password length.

@return Exception\StandardException|null
Checking if user password is fine . In case of error exception is thrown