function ban_ip_form_submit

Form submission handler for ban_ip_form().

See also

ban_ip_form_validate()

File

drupal/core/modules/ban/ban.admin.inc, line 101
Administrative functionality for the Ban module.

Code

function ban_ip_form_submit($form, &$form_state) {
  $ip = trim($form_state['values']['ip']);
  db_insert('ban_ip')
    ->fields(array(
    'ip' => $ip,
  ))
    ->execute();
  drupal_set_message(t('The IP address %ip has been banned.', array(
    '%ip' => $ip,
  )));
  $form_state['redirect'] = 'admin/config/people/ban';
}