You are here

function spam_user_report_validate in Spam 5

Validation code for the spam_user_report form/function

File

./spam.module, line 927

Code

function spam_user_report_validate($form_id, $form_values) {

  /* spam/report/<type>/<id>
   * 0    1      2      3
   */
  global $user;
  $source = arg(2);
  $id = arg(3);
  $previous = db_fetch_object(db_query("SELECT rid FROM {spam_reported} WHERE source = '%s' AND id = %d AND uid = %d", $source, $id, $user->uid));

  // if admin lets anonymous users report spam, duplicates are allowed...
  if ($user->uid && $previous->rid) {
    form_set_error('', t('You have already reported this content as spam.  The site administrator has been notified and will review the content shortly.'));
  }
}