You are here

function spam_admin_settings_limits in Spam 5

1 string reference to 'spam_admin_settings_limits'
spam_menu in ./spam.module
Implementation of hook_menu().

File

./spam.module, line 327

Code

function spam_admin_settings_limits() {

  // limits
  $form['limits'] = array(
    '#type' => 'fieldset',
    '#title' => 'Limits',
  );
  $limits = array(
    -1 => t('unlimited'),
    0 => t('none'),
    1 => 1,
    2 => 2,
    3 => 3,
    4 => 4,
    5 => 5,
    6 => 6,
    7 => 7,
    8 => 8,
    9 => 9,
    10 => 10,
    15 => 15,
    20 => 20,
    50 => 50,
    100 => 100,
  );
  $form['limits']['spam_urls_total'] = array(
    '#type' => 'select',
    '#title' => t('Maximum allowed URLs'),
    '#default_value' => variable_get('spam_urls_total', 10),
    '#options' => $limits,
    '#description' => t('Specificy the maximum number of URLs that are allowed in a single posting before it is considered to be spam.  For example, if you select 5 from the pop down menu, and then a posting to your site has 6 weblinks, the posting will be marked as spam.  Some form of filtering must be enabled above for this to have any affect.'),
  );
  unset($limits[0]);
  $form['limits']['spam_urls_repeat'] = array(
    '#type' => 'select',
    '#title' => t('Maximum repeat URLs'),
    '#default_value' => variable_get('spam_urls_repeat', 5),
    '#options' => $limits,
    '#description' => t('Specificy the maximum number of times that the same URL  is allowed to appear in a single posting before it is considered to be spam.  For example, if you select 5 from the pop down menu, and then a posting has 6 weblinks to the same exact location, the posting will be marked as spam.  Some form of filtering must be enabled above for this to have any affect.'),
  );
  $form['limits']['spam_duplicate_content'] = array(
    '#type' => 'select',
    '#title' => t('Maximum duplicate content'),
    '#default_value' => variable_get('spam_duplicate_content', 2),
    '#options' => $limits,
    '#description' => t('Specify the maximum number of times the same identical posting will be allowed to your site before all of the duplicate postings are considered spam.  Some times a user may accidently hit "submit" multiple times, causing an otherwise acceptible posting to be duplicated.  However, other times a spammer may repeatedly post the same spam content to your site.'),
  );
  $form['limits']['spam_blacklist_ip'] = array(
    '#type' => 'select',
    '#title' => t('Detected spam postings before blacklisting IP'),
    '#default_value' => variable_get('spam_blacklist_ip', 2),
    '#options' => $limits,
    '#description' => t('Select the number of times a single IP address needs to be detected posting probable spam before the IP is blacklisted.  If enabled, future attempts to post any content will cause a 25 second delay, after which the user will be redirected to the site\'s front page where they will receive notification that their IP address is currently blacklisted.  It is advisable that you configure your site to require all content be previewed if you wish to use this functionality, as that will allow the filter to blacklist a user <em>before</em> the content is posted, minimizing database overhead.  If you configure spam to automatically expire, the IP will only be blacklisted until the previous spam from that IP expires.  A blacklisted IP is only prevented from posting new content, they are still allowed to view existing content.'),
  );
  return system_settings_form($form);
}