function ban_ip_form

Form constructor for banning an IP address.

Parameters

string $default_ip: An IP address to ban, used as default value.

See also

ban_ip_form_validate()

ban_ip_form_submit()

Related topics

1 string reference to 'ban_ip_form'
ban_admin_page in drupal/core/modules/ban/ban.admin.inc
Page callback: Displays banned IP addresses.

File

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

Code

function ban_ip_form($form, &$form_state, $default_ip) {
  $form['ip'] = array(
    '#title' => t('IP address'),
    '#type' => 'textfield',
    '#size' => 48,
    '#maxlength' => 40,
    '#default_value' => $default_ip,
    '#description' => t('Enter a valid IP address.'),
  );
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add'),
  );
  return $form;
}