You are here

function path2ban_settings in path2ban 7

Same name and namespace in other branches
  1. 7.2 includes/settings.inc \path2ban_settings()

Display path2ban settings form.

1 string reference to 'path2ban_settings'
path2ban_menu in ./path2ban.module
Implements hook_menu().

File

./path2ban.module, line 29
path2ban module.

Code

function path2ban_settings() {

  //TODO: hard and soft IP block
  $form = array();
  $form['path2ban_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('path2ban options'),
  );
  $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array(
    '%blog' => 'blog',
    '%blog-wildcard' => 'blog/*',
    '%front' => '<front>',
  ));
  $form['path2ban_options']['path2ban_list'] = array(
    '#type' => 'textarea',
    '#title' => t('List of restricted paths'),
    '#description' => $description,
    '#default_value' => variable_get('path2ban_list', ''),
    '#rows' => 25,
  );
  $form['path2ban_options']['path2ban_threshold_limit'] = array(
    '#type' => 'textfield',
    '#title' => t('Threshold limit'),
    //'#description' => t('Please enter the ...'),
    '#default_value' => variable_get('path2ban_threshold_limit', 5),
  );
  $form['path2ban_options']['path2ban_threshold_window'] = array(
    '#type' => 'textfield',
    '#title' => t('Threshold window'),
    '#description' => t('Please enter the threshold window in seconds'),
    '#default_value' => variable_get('path2ban_threshold_window', 3600),
  );
  $form['path2ban_options']['path2ban_notify'] = array(
    '#type' => 'checkbox',
    '#title' => t('Notify User One?'),
    '#default_value' => variable_get('path2ban_notify', 0),
    '#description' => t('Notify User One by email about blocked IP addresses'),
  );

  /*  $form['path2ban_options']['path2ban_test_mode'] = array(
      '#type' => 'checkbox',
      '#title' => t('Test mode'),
      '#default_value' => variable_get('path2ban_test_mode', 0),
      '#description' => t('Do not block any IP addresses'),
    );*/
  return system_settings_form($form);
}