Helper/Data.php
public function isIpAllowed()
    {
        if ($ipString = $this->getConfigValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_IP_RESTRICTION_ADDRESSES,
            'default'
        )
        ) {
            //string to array
            $ipArray = explode(',', $ipString);

            //remove white spaces
            foreach ($ipArray as $key => $ip) {
                $ipArray[$key] = trim($ip);
            }

            //ip address
            $ipAddress = $this->_remoteAddress->getRemoteAddress();

            if (in_array($ipAddress, $ipArray)) {
                return true;
            }
        } else {
            //empty ip list from configuration will ignore the validation
            return true;
        }

        $this->log(sprintf("Failed to authenticate IP address - %s", $ipAddress));

        return false;
    }
public function isIpAllowed()
    {
        if ($ipString = $this->getConfigValue(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_IP_RESTRICTION_ADDRESSES,
            'default'
        )
        ) {
            //string to array
            $ipArray = explode(',', $ipString);

            //remove white spaces
            foreach ($ipArray as $key => $ip) {
                $ipArray[$key] = trim($ip);
            }

            //ip address
            $ipAddress = $this->_remoteAddress->getRemoteAddress();

            if (in_array($ipAddress, $ipArray)) {
                return true;
            }
        } else {
            //empty ip list from configuration will ignore the validation
            return true;
        }

        $this->log(sprintf("Failed to authenticate IP address - %s", $ipAddress));

        return false;
    }
public function isIpAllowed ( ) { if ( $ ipString = $ this -> getConfigValue ( \ Dotdigitalgroup \ Email \ Helper \ Config :: XML_PATH_CONNECTOR_IP_RESTRICTION_ADDRESSES , 'default' ) ) { //string to array $ ipArray = explode ( ',' , $ ipString ) ; //remove white spaces foreach ( $ ipArray as $ key => $ ip ) { $ ipArray [ $ key ] = trim ( $ ip ) ; } //ip address $ ipAddress = $ this -> _remoteAddress -> getRemoteAddress ( ) ; if ( in_array ( $ ipAddress , $ ipArray ) ) { return true ; } } else { //empty ip list from configuration will ignore the validation return true ; } $ this -> log ( sprintf ( "Failed to authenticate IP address - %s" , $ ipAddress ) ) ; return false ; }
Check for IP address to match the ones from config.

@return bool
Check for IP address to match the ones from config .