class IpAllowDeny (View source)

PhpMyAdmin\IpAllowDeny class

Methods

__construct()

No description

bool
ipMaskTest(string $testRange, string $ipToTest)

Matches for IPv4 or IPv6 addresses

bool
ipv4MaskTest(string $testRange, string $ipToTest)

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

bool
ipv6MaskTest(string $testRange, string $ipToTest)

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

__construct()

No description

bool 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

bool

bool ipv4MaskTest(string $testRange, string $ipToTest)

Based on IP Pattern Matcher Originally by J.Adams jna@retina.net Found on https://www.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

bool

bool ipv6MaskTest(string $testRange, string $ipToTest)

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 $testRange

string of IP range to match

string $ipToTest

string of IP to test against range

Return Value

bool

bool allow()

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

Return Value

bool

See also

Core::getIp

bool deny()

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

Return Value

bool

See also

Core::getIp