class FloodUnblockCommands in Flood Unblock 8
Same name and namespace in other branches
- 8.2 src/Commands/FloodUnblockCommands.php \Drupal\flood_unblock\Commands\FloodUnblockCommands
Flood unblock. module's Drush 9 commands.
Hierarchy
- class \Drupal\flood_unblock\Commands\FloodUnblockCommands extends \Drush\Commands\DrushCommands
Expanded class hierarchy of FloodUnblockCommands
1 string reference to 'FloodUnblockCommands'
1 service uses FloodUnblockCommands
File
- src/
Commands/ FloodUnblockCommands.php, line 11
Namespace
Drupal\flood_unblock\CommandsView source
class FloodUnblockCommands extends DrushCommands {
/**
* @var FloodUnblockManager
*/
private $manager;
/**
* FloodUnblockCommands constructor.
*
* @param \Drupal\flood_unblock\FloodUnblockManager $manager
*/
public function __construct(FloodUnblockManager $manager) {
$this->manager = $manager;
}
/**
* Clears the floods based on IP.
*
* @param string $ip
* IP to clear.
*
* @command flood_unblock:ip
* @usage flood_unblock:ip
*/
public function unblockIp($ip = NULL) {
$this->manager
->flood_unblock_clear_event('user.failed_login_ip', $ip);
$this
->output()
->writeln('Done');
}
/**
* Clears the floods based on user.
*
* @param string $user
* User to clear...
*
* @command flood_unblock:user
* @usage flood_unblock:user
*/
public function unblockUser($user = NULL) {
$this->manager
->flood_unblock_clear_event('user.failed_login_user', $user);
$this
->output()
->writeln('Done');
}
/**
* Clears all floods in the system.
*
* @command flood_unblock:all
* @usage flood_unblock:all
*/
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');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FloodUnblockCommands:: |
private | property | ||
FloodUnblockCommands:: |
public | function | Clears all floods in the system. | |
FloodUnblockCommands:: |
public | function | Clears the floods based on IP. | |
FloodUnblockCommands:: |
public | function | Clears the floods based on user. | |
FloodUnblockCommands:: |
public | function | FloodUnblockCommands constructor. |