You are here

function ip_ranges_delete_submit in IP Ranges 7

Same name and namespace in other branches
  1. 7.2 ip_ranges.admin.inc \ip_ranges_delete_submit()

Processes ip_ranges_delete form submissions.

File

./ip_ranges.admin.inc, line 135
Page callback file for the ip ranges module.

Code

function ip_ranges_delete_submit($form, &$form_state) {
  $ip = $form_state['build_info']['args']['1'];
  $bid = $form_state['values']['ip_range'];
  db_delete('ip_ranges')
    ->condition('bid', $bid)
    ->execute();
  watchdog('user', 'Deleted %ip from banned ip-ranges', array(
    '%ip' => $ip,
  ));
  drupal_set_message(t('The IP address/range %ip was deleted.', array(
    '%ip' => str_replace('-', ' - ', $ip),
  )));
  $form_state['redirect'] = 'admin/config/people/ip-ranges';
}