src/ShopPaymentIPNBundle/objects/db/TPkgShopPaymentIPN_TPkgShopPaymentHandlerGroup.class.php
public function isValidIP($sIP)
    {
        $bAllowed = false;
        $sIPSource = trim($this->fieldIpnAllowedIps);
        if ('' === $sIPSource) {
            return true;
        }

        $oNetworkHelper = new TPkgCoreUtility_Network();
        $aIPList = explode("\n", $sIPSource);
        foreach ($aIPList as $sAllowedIP) {
            $sRangeType = $oNetworkHelper->getRangeType($sAllowedIP);
            switch ($sRangeType) {
                case TPkgCoreUtility_Network::IP_RANGE_TYPE_NONE:
                    $bAllowed = ($sIP === $sAllowedIP);
                    break;
                case TPkgCoreUtility_Network::IP_RANGE_TYPE_RANGE:
                case TPkgCoreUtility_Network::IP_RANGE_TYPE_WILDCARD:
                case TPkgCoreUtility_Network::IP_RANGE_TYPE_CIDR:
                    $bAllowed = $oNetworkHelper->ipIsInRange($sIP, $sAllowedIP);
                    break;
            }

            if (true === $bAllowed) {
                break;
            }
        }

        return $bAllowed;
    }
public function isValidIP($sIP)
    {
        $bAllowed = false;
        $sIPSource = trim($this->fieldIpnAllowedIps);
        if ('' === $sIPSource) {
            return true;
        }

        $oNetworkHelper = new TPkgCoreUtility_Network();
        $aIPList = explode("\n", $sIPSource);
        foreach ($aIPList as $sAllowedIP) {
            $sRangeType = $oNetworkHelper->getRangeType($sAllowedIP);
            switch ($sRangeType) {
                case TPkgCoreUtility_Network::IP_RANGE_TYPE_NONE:
                    $bAllowed = ($sIP === $sAllowedIP);
                    break;
                case TPkgCoreUtility_Network::IP_RANGE_TYPE_RANGE:
                case TPkgCoreUtility_Network::IP_RANGE_TYPE_WILDCARD:
                case TPkgCoreUtility_Network::IP_RANGE_TYPE_CIDR:
                    $bAllowed = $oNetworkHelper->ipIsInRange($sIP, $sAllowedIP);
                    break;
            }

            if (true === $bAllowed) {
                break;
            }
        }

        return $bAllowed;
    }
public function isValidIP ( $ sIP ) { $ bAllowed = false ; $ sIPSource = trim ( $ this -> fieldIpnAllowedIps ) ; if ( '' === $ sIPSource ) { return true ; } $ oNetworkHelper = new TPkgCoreUtility_Network ( ) ; $ aIPList = explode ( "\n" , $ sIPSource ) ; foreach ( $ aIPList as $ sAllowedIP ) { $ sRangeType = $ oNetworkHelper -> getRangeType ( $ sAllowedIP ) ; switch ( $ sRangeType ) { case TPkgCoreUtility_Network :: IP_RANGE_TYPE_NONE : $ bAllowed = ( $ sIP === $ sAllowedIP ) ; break ; case TPkgCoreUtility_Network :: IP_RANGE_TYPE_RANGE : case TPkgCoreUtility_Network :: IP_RANGE_TYPE_WILDCARD : case TPkgCoreUtility_Network :: IP_RANGE_TYPE_CIDR : $ bAllowed = $ oNetworkHelper -> ipIsInRange ( $ sIP , $ sAllowedIP ) ; break ; } if ( true === $ bAllowed ) { break ; } } return $ bAllowed ; }
return true if the ip may send IPN to this payment type.

@param $sIP

@return bool
return true if the ip may send IPN to this payment type .