Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe FOFUtilsIp

Fonctions membres publiques statiques

static getIp ()
 
static setIp ($ip)
 
static isIPv6 ($ip)
 
static IPinList ($ip, $ipTable='')
 
static workaroundIPIssues ()
 
static setAllowIpOverrides ($newState)
 

Fonctions membres protégées statiques

static detectAndCleanIP ()
 
static detectIP ()
 
static inet_to_bits ($inet)
 
static checkIPv6CIDR ($ip, $cidrnet)
 

Attributs protégés statiques

static $ip = null
 
static $allowIpOverrides = true
 

Description détaillée

IP address utilities

Documentation des fonctions membres

◆ checkIPv6CIDR()

static checkIPv6CIDR (   $ip,
  $cidrnet 
)
staticprotected

Checks if an IPv6 address $ip is part of the IPv6 CIDR block $cidrnet

Paramètres
string$ipThe IPv6 address to check, e.g. 21DA:00D3:0000:2F3B:02AC:00FF:FE28:9C5A
string$cidrnetThe IPv6 CIDR block, e.g. 21DA:00D3:0000:2F3B::/64
Renvoie
bool

◆ detectAndCleanIP()

static detectAndCleanIP ( )
staticprotected

Gets the visitor's IP address. Automatically handles reverse proxies reporting the IPs of intermediate devices, like load balancers. Examples: https://www.akeebabackup.com/support/admin-tools/13743-double-ip-adresses-in-security-exception-log-warnings.html http://stackoverflow.com/questions/2422395/why-is-request-envremote-addr-returning-two-ips The solution used is assuming that the last IP address is the external one.

Renvoie
string

◆ detectIP()

static detectIP ( )
staticprotected

Gets the visitor's IP address

Renvoie
string

◆ getIp()

static getIp ( )
static

Get the current visitor's IP address

Renvoie
string

◆ inet_to_bits()

static inet_to_bits (   $inet)
staticprotected

Converts inet_pton output to bits string

Paramètres
string$inetThe in_addr representation of an IPv4 or IPv6 address
Renvoie
string

◆ IPinList()

static IPinList (   $ip,
  $ipTable = '' 
)
static

Checks if an IP is contained in a list of IPs or IP expressions

Paramètres
string$ipThe IPv4/IPv6 address to check
array | string$ipTableAn IP expression (or a comma-separated or array list of IP expressions) to check against
Renvoie
null|boolean True if it's in the list

Références $base, $i, et elseif.

◆ isIPv6()

static isIPv6 (   $ip)
static

Is it an IPv6 IP address?

Paramètres
string$ipAn IPv4 or IPv6 address
Renvoie
boolean True if it's IPv6

◆ setAllowIpOverrides()

static setAllowIpOverrides (   $newState)
static

Should I allow the remote client's IP to be overridden by an X-Forwarded-For or Client-Ip HTTP header?

Paramètres
bool$newStateTrue to allow the override
Renvoie
void

Références true.

◆ setIp()

static setIp (   $ip)
static

Set the IP address of the current visitor

Paramètres
string$ip
Renvoie
void

◆ workaroundIPIssues()

static workaroundIPIssues ( )
static

Works around the REMOTE_ADDR not containing the user's IP

Références elseif.

Documentation des champs

◆ $allowIpOverrides

$allowIpOverrides = true
staticprotected

◆ $ip

$ip = null
staticprotected

La documentation de cette classe a été générée à partir du fichier suivant :