class IpAllowDeny

PhpMyAdmin\IpAllowDeny class

Methods

boolean
ipMaskTest(string $testRange, string $ipToTest)

Matches for IPv4 or IPv6 addresses

boolean
ipv4MaskTest(string $testRange, string $ipToTest)

Based on IP Pattern Matcher Originally by J.Adams jna@retina.net Found on https://secure.php.net/manual/en/function.ip2long.php Modified for phpMyAdmin

boolean
ipv6MaskTest(string $test_range, string $ip_to_test)

IPv6 matcher CIDR section taken from https://stackoverflow.com/a/10086404 Modified for phpMyAdmin

bool
allow()

Runs through IP Allow rules the use of it below for more information

bool
deny()

Runs through IP Deny rules the use of it below for more information

Details

at line 31
boolean ipMaskTest(string $testRange, string $ipToTest)

Matches for IPv4 or IPv6 addresses

Parameters

string $testRange string of IP range to match
string $ipToTest string of IP to test against range

Return Value

boolean whether the IP mask matches

at line 66
boolean ipv4MaskTest(string $testRange, string $ipToTest)

Based on IP Pattern Matcher Originally by J.Adams jna@retina.net Found on https://secure.php.net/manual/en/function.ip2long.php Modified for phpMyAdmin

Matches: xxx.xxx.xxx.xxx (exact) xxx.xxx.xxx.[yyy-zzz] (range) xxx.xxx.xxx.xxx/nn (CIDR)

Does not match: xxx.xxx.xxx.xx[yyy-zzz] (range, partial octets not supported)

Parameters

string $testRange string of IP range to match
string $ipToTest string of IP to test against range

Return Value

boolean whether the IP mask matches

at line 136
boolean ipv6MaskTest(string $test_range, string $ip_to_test)

IPv6 matcher CIDR section taken from https://stackoverflow.com/a/10086404 Modified for phpMyAdmin

Matches: xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx (exact) xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:[yyyy-zzzz] (range, only at end of IP - no subnets) xxxx:xxxx:xxxx:xxxx/nn (CIDR)

Does not match: xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx[yyy-zzz] (range, partial octets not supported)

Parameters

string $test_range string of IP range to match
string $ip_to_test string of IP to test against range

Return Value

boolean whether the IP mask matches

at line 231
bool allow()

Runs through IP Allow rules the use of it below for more information

Return Value

bool Whether rule has matched

See also

at line 245
bool deny()

Runs through IP Deny rules the use of it below for more information

Return Value

bool Whether rule has matched

See also