You are here

function autoban_delete_submit in Automatic IP ban (Autoban) 7

Processes autoban_delete form submissions.

File

./autoban.admin.inc, line 419
Configuration for autoban module.

Code

function autoban_delete_submit($form, &$form_state) {
  $rid = $form_state['values']['rule_id'];
  if (!empty($rid)) {
    db_delete('autoban')
      ->condition('rid', $rid)
      ->execute();
    watchdog('autoban', 'Deleted %id from autoban rules.', array(
      '%id' => $rid,
    ));
    drupal_set_message(t('The autoban rules %id was deleted.', array(
      '%id' => $rid,
    )));

    // Reset stored rules.
    drupal_static_reset('autoban_get_rules');
    $form_state['redirect'] = AUTOBAN_BASE_URL;
  }
}