Свойство | Тип | Описание | |
---|---|---|---|
$allowIpOverrides | boolean | Should I allow IP overrides through X-Forwarded-For or Client-Ip HTTP headers? | |
$ip | string | The IP address of the current visitor |
Метод | Описание | |
---|---|---|
IPinList ( string $ip, array | string $ipTable = '' ) : null | boolean | Checks if an IP is contained in a list of IPs or IP expressions | |
getIp ( ) : string | Get the current visitor's IP address | |
setAllowIpOverrides ( boolean $newState ) : void | Should I allow the remote client's IP to be overridden by an X-Forwarded-For or Client-Ip HTTP header? | |
setIp ( string $ip ) : void | Set the IP address of the current visitor | |
workaroundIPIssues ( ) | Works around the REMOTE_ADDR not containing the user's IP |
Метод | Описание | |
---|---|---|
checkIPv6CIDR ( string $ip, string $cidrnet ) : boolean | Checks if an IPv6 address $ip is part of the IPv6 CIDR block $cidrnet | |
detectAndCleanIP ( ) : string | 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. | |
detectIP ( ) : string | Gets the visitor's IP address | |
inet_to_bits ( string $inet ) : string | Converts inet_pton output to bits string | |
isIPv6 ( string $ip ) : boolean | Is it an IPv6 IP address? |
protected static detectAndCleanIP ( ) : string | ||
Результат | string |
protected static inet_to_bits ( string $inet ) : string | ||
$inet | string | The in_addr representation of an IPv4 or IPv6 address |
Результат | string |
public static setAllowIpOverrides ( boolean $newState ) : void | ||
$newState | boolean | True to allow the override |
Результат | void |
public static workaroundIPIssues ( ) |
protected static bool $allowIpOverrides | ||
Результат | boolean |
protected static string $ip | ||
Результат | string |