You are here

function spambot_user_spam_admin_form_validate in Spambot 7

Same name and namespace in other branches
  1. 6.3 spambot.pages.inc \spambot_user_spam_admin_form_validate()

Validate handler for spambot_user_spam_admin_form() form.

1 string reference to 'spambot_user_spam_admin_form_validate'
spambot_user_spam_admin_form in ./spambot.pages.inc
Form builder for spambot_user_spam_admin_form form.

File

./spambot.pages.inc, line 185
User available pages from Spambot module.

Code

function spambot_user_spam_admin_form_validate(&$form, &$form_state) {
  $key_required = !empty($form_state['values']['report']['nids']) && count(array_filter($form_state['values']['report']['nids'])) ? TRUE : FALSE;
  if (module_exists('comment')) {
    $key_required = !empty($form_state['values']['report']['cids']) && count(array_filter($form_state['values']['report']['cids'])) || $key_required;
  }
  if ($key_required && !variable_get('spambot_sfs_api_key', FALSE)) {
    form_set_error('', t('To report spammers to www.stopforumspam.com, you need to register for an API key at <a href="http://www.stopforumspam.com">www.stopforumspam.com</a> and enter it into the !page.', array(
      '!page' => l(t('spambot settings'), 'admin/config/system/spambot'),
    )));
  }
}