You are here

public function AdvbanIpManager::unbanIp in Advanced ban 8

Unbans an IP address.

Parameters

string $ip: The IP address to unban.

string $ip_end: The end of the IP address to ban (optional).

Overrides AdvbanIpManagerInterface::unbanIp

File

src/AdvbanIpManager.php, line 194

Class

AdvbanIpManager
Ban IP manager.

Namespace

Drupal\advban

Code

public function unbanIp($ip, $ip_end = '') {
  $query = $this->connection
    ->delete('advban_ip');
  if (!empty($ip_end)) {
    $query
      ->condition('ip', $ip);
    $query
      ->condition('ip_end', $ip_end);
  }
  else {
    $query
      ->condition('ip', $ip);
  }
  $query
    ->execute();
}