You are here

private function AutobanCommands::banRule in Automatic IP ban (Autoban) 8

Rule ban.

Parameters

string $rule: Autoban rule id.

Return value

int Banned IP count.

1 call to AutobanCommands::banRule()
AutobanCommands::ban in src/Commands/AutobanCommands.php
Autoban IP ban.

File

src/Commands/AutobanCommands.php, line 90

Class

AutobanCommands
A Drush commandfile.

Namespace

Drupal\autoban\Commands

Code

private function banRule($rule) {
  $bannedIp = $this->autoban
    ->getBannedIp($rule);
  $banned = 0;
  if ($bannedIp) {
    $banned = $this->autoban
      ->banIpList($bannedIp, $rule);
  }
  return $banned;
}