class IPRangesManager in IP Ranges 8
Hierarchy
- class \Drupal\ip_ranges\IPRangesManager
Expanded class hierarchy of IPRangesManager
1 file declares its use of IPRangesManager
- IPRangesEventSubscriber.php in lib/
Drupal/ ip_ranges/ EventSubscriber/ IPRangesEventSubscriber.php
1 string reference to 'IPRangesManager'
1 service uses IPRangesManager
File
- lib/
Drupal/ ip_ranges/ IPRangesManager.php, line 7
Namespace
Drupal\ip_rangesView source
class IPRangesManager {
public function __construct(Connection $connection) {
$this->connection = $connection;
}
public function ipIsBanned($ip) {
$args = array(
':ip' => ip2long($ip),
);
$sql = "SELECT * FROM {ip_ranges} WHERE type = :type AND ip_lower <= :ip AND ip_higher >= :ip";
$banned = $this->connection
->queryRange($sql, 0, 1, $args + array(
':type' => 0,
))
->fetchField() && !$this->connection
->queryRange($sql, 0, 1, $args + array(
':type' => 1,
))
->fetchField();
return $banned;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IPRangesManager:: |
public | function | ||
IPRangesManager:: |
public | function |