You are here

function flood_unblock_drush_clear in Flood Unblock 7

Clear the flood events.

1 string reference to 'flood_unblock_drush_clear'
flood_unblock_clear_drush in ./flood_unblock.drush.inc
Command callback for drush flood-unblock.

File

./flood_unblock.drush.inc, line 60
Drush integration for the Flood Unblock module.

Code

function flood_unblock_drush_clear($type) {
  switch ($type) {
    case 'ip':
      flood_unblock_clear_event('failed_login_attempt_ip', NULL);
      break;
    case 'user':
      flood_unblock_clear_event('failed_login_attempt_user', NULL);
      break;
    default:
      flood_unblock_clear_event('failed_login_attempt_ip', NULL);
      flood_unblock_clear_event('failed_login_attempt_user', NULL);
      break;
  }
  if ($type != 'all') {
    drush_print(dt('Flood cleared for the !event event.', array(
      '!event' => $type,
    )));
  }
  else {
    drush_print(dt('Flood cleared for all events.'));
  }
}