You are here

public function AdvbanIpManager::unblockExpiredIp in Advanced ban 8

Unblock expired banned IP.

Overrides AdvbanIpManagerInterface::unblockExpiredIp

File

src/AdvbanIpManager.php, line 308

Class

AdvbanIpManager
Ban IP manager.

Namespace

Drupal\advban

Code

public function unblockExpiredIp() {
  $query = $this->connection
    ->delete('advban_ip');
  $query
    ->condition('expiry_date', 0, '>');
  $query
    ->condition('expiry_date', strtotime('now'), '<');
  return $query
    ->execute();
}