You are here

function autoban_clear_tables_form in Automatic IP ban (Autoban) 7

Clear tables.

See also

autoban_clear_tables_form_submit()

1 string reference to 'autoban_clear_tables_form'
autoban_menu in ./autoban.module
Implements hook_menu().

File

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

Code

function autoban_clear_tables_form($form, &$form_state) {
  $form['clear_tables'] = array(
    '#title' => t('Clear tables'),
  );
  $tables_list = array(
    'autoban' => t('Autoban rules'),
    'watchdog' => t('Log messages'),
    'blocked_ips' => t('IP address blocking'),
  );
  if (_autoban_blocked_ips_expire_enable()) {
    $tables_list['blocked_ips'] .= ' (' . t('with blocked_ips_expire') . ')';
  }
  if (_autoban_ip_ranges_enable()) {
    $tables_list['ip_ranges'] = t('IP range bans (blacklist)');
  }
  $form['clear_tables']['tables'] = array(
    '#title' => t('Tables'),
    '#type' => 'checkboxes',
    '#options' => $tables_list,
    '#required' => TRUE,
  );
  $form['clear_tables']['actions'] = array(
    '#type' => 'actions',
  );
  $form['clear_tables']['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Clear'),
  );
  return $form;
}