lib/ezutils/classes/ezdebug.php
private static function isAllowedByCurrentIP( $allowedIpList )
    {
        $ipAddresIPV4Pattern = "/^(([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+))(\/([0-9]+)$|$)/";
        $ipAddressIPV6Pattern = "/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))(\/([0-9]+)$|$)$/";

        $ipAddress = eZSys::clientIP();
        if ( $ipAddress )
        {
            foreach( $allowedIpList as $itemToMatch )
            {
                // Test for IPv6 Addresses first instead of IPv4 addresses as IPv6
                // addresses can contain dot separators within them
                if ( preg_match( "/:/", $ipAddress ) )
                {
                    if ( preg_match( $ipAddressIPV6Pattern, $itemToMatch, $matches ) )
                    {
                        if ( $matches[69] )
                        {
                            if ( self::isIPInNetIPv6( $ipAddress, $itemToMatch ) )
                            {
                                return true;
                            }

                        }
                        else
                        {
                            if ( $matches[1] == $itemToMatch )
                            {
                                return true;
                            }
                        }
                    }
                }
                elseif ( preg_match( "/\./", $ipAddress) )
                {
                    if ( preg_match( $ipAddresIPV4Pattern, $itemToMatch, $matches ) )
                    {
                        if ( $matches[6] )
                        {
                            if ( self::isIPInNet( $ipAddress, $matches[1], $matches[7] ) )
                            {
                                return true;
                             }
                        }
                        else
                        {
                            if ( $matches[1] == $ipAddress )
                            {
                                return true;
                            }
                        }
                    }
                }
            }

            return false;
        }
        else
        {
            return eZSys::isShellExecution() && in_array( 'commandline', $allowedIpList );
        }
    }
private static function isAllowedByCurrentIP( $allowedIpList )
    {
        $ipAddresIPV4Pattern = "/^(([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+))(\/([0-9]+)$|$)/";
        $ipAddressIPV6Pattern = "/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))(\/([0-9]+)$|$)$/";

        $ipAddress = eZSys::clientIP();
        if ( $ipAddress )
        {
            foreach( $allowedIpList as $itemToMatch )
            {
                // Test for IPv6 Addresses first instead of IPv4 addresses as IPv6
                // addresses can contain dot separators within them
                if ( preg_match( "/:/", $ipAddress ) )
                {
                    if ( preg_match( $ipAddressIPV6Pattern, $itemToMatch, $matches ) )
                    {
                        if ( $matches[69] )
                        {
                            if ( self::isIPInNetIPv6( $ipAddress, $itemToMatch ) )
                            {
                                return true;
                            }

                        }
                        else
                        {
                            if ( $matches[1] == $itemToMatch )
                            {
                                return true;
                            }
                        }
                    }
                }
                elseif ( preg_match( "/\./", $ipAddress) )
                {
                    if ( preg_match( $ipAddresIPV4Pattern, $itemToMatch, $matches ) )
                    {
                        if ( $matches[6] )
                        {
                            if ( self::isIPInNet( $ipAddress, $matches[1], $matches[7] ) )
                            {
                                return true;
                             }
                        }
                        else
                        {
                            if ( $matches[1] == $ipAddress )
                            {
                                return true;
                            }
                        }
                    }
                }
            }

            return false;
        }
        else
        {
            return eZSys::isShellExecution() && in_array( 'commandline', $allowedIpList );
        }
    }
private static function isAllowedByCurrentIP ( $ allowedIpList ) { $ ipAddresIPV4Pattern = "/^(([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+))(\/([0-9]+)$|$)/" ; $ ipAddressIPV6Pattern = "/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))(\/([0-9]+)$|$)$/" ; $ ipAddress = eZSys :: clientIP ( ) ; if ( $ ipAddress ) { foreach ( $ allowedIpList as $ itemToMatch ) { // Test for IPv6 Addresses first instead of IPv4 addresses as IPv6 // addresses can contain dot separators within them if ( preg_match ( "/:/" , $ ipAddress ) ) { if ( preg_match ( $ ipAddressIPV6Pattern , $ itemToMatch , $ matches ) ) { if ( $ matches [ 69 ] ) { if ( self :: isIPInNetIPv6 ( $ ipAddress , $ itemToMatch ) ) { return true ; } } else { if ( $ matches [ 1 ] == $ itemToMatch ) { return true ; } } } } elseif ( preg_match ( "/\./" , $ ipAddress ) ) { if ( preg_match ( $ ipAddresIPV4Pattern , $ itemToMatch , $ matches ) ) { if ( $ matches [ 6 ] ) { if ( self :: isIPInNet ( $ ipAddress , $ matches [ 1 ] , $ matches [ 7 ] ) ) { return true ; } } else { if ( $ matches [ 1 ] == $ ipAddress ) { return true ; } } } } } return false ; } else { return eZSys :: isShellExecution ( ) && in_array ( 'commandline' , $ allowedIpList ) ; } }
If debugging is allowed for the current IP address.

@param array $allowedIpList
@return bool
If debugging is allowed for the current IP address .