FloodUnblockCommands.php in Flood Unblock 8
File
src/Commands/FloodUnblockCommands.php
View source
<?php
namespace Drupal\flood_unblock\Commands;
use Drush\Commands\DrushCommands;
use Drupal\flood_unblock\FloodUnblockManager;
class FloodUnblockCommands extends DrushCommands {
private $manager;
public function __construct(FloodUnblockManager $manager) {
$this->manager = $manager;
}
public function unblockIp($ip = NULL) {
$this->manager
->flood_unblock_clear_event('user.failed_login_ip', $ip);
$this
->output()
->writeln('Done');
}
public function unblockUser($user = NULL) {
$this->manager
->flood_unblock_clear_event('user.failed_login_user', $user);
$this
->output()
->writeln('Done');
}
public function unblockAll() {
$this->manager
->flood_unblock_clear_event('user.failed_login_ip', NULL);
$this->manager
->flood_unblock_clear_event('user.failed_login_user', NULL);
$this->manager
->flood_unblock_clear_event('user.http_login', NULL);
$this
->output()
->writeln('Done');
}
}