It appears that profile2.module profiles don't count as evidence, even when they have very spammy links in them. (I know that these people are spammers for other reasons, include their distinctive .pl emails, but it'd be hard to code these as evidence). When I try to report them at URLs like /user/7270/spambot I see:

This account has 0 nodes and 0 comments.
Report this account to www.stopforumspam.com
This account cannot be reported because no evidence or IP address is available.

Can we change this?

Comments

Tom Ash created an issue.

jvieille’s picture

I have done that this way in D6 (not a patch, just a manual changes highlight)
In my case, I check what the subscriber has filled up in a "Motivation" text field. Most trolls just put 2 arbitrary letters that are more than enough to deduct their nefarious intent. This provides an example of what can be done with any profile or content profile fields. D7 shall not be much different.

In spambot.pages.inc,

function spambot_user_spam_admin_form:

  // Fetch a list of reportable comments
  if (module_exists('comment')) {
    $form['action']['report']['cids'] = array();
    $result = db_query("SELECT cid FROM {comments} WHERE uid = %d ORDER BY cid DESC LIMIT 20", $account->uid);
    $cids = array();
    while ($object = db_fetch_object($result)) {
      $cids[$object->cid] = $object->cid;
    }
    
    foreach ($cids as $cid) {
      $comment = _comment_load($cid);
      if (!empty($comment->cid)) {
        $form['action']['report']['cids'][$cid] = array(
          '#type' => 'checkbox',
          '#title' => l(mb_strimwidth($comment->subject, 0, 128, '...'), 'node/' . $comment->nid, array('fragment' => 'comment-'. $comment->cid, 'attributes' => array('title' => mb_strimwidth($comment->comment, 0, 256, '...')))) . ' ' . t('(comment, ip=@ip)', array('@ip' => $comment->hostname)),
          '#disabled' => empty($key),
        );
      }
    }
  }
+// Report subscribers who submit less than 5 characters motivation
+  $form['action']['report']['profile'] = array();
+// this checks the content of a particular profile field. Add all you want here as $form['action']['report']['profile']['xxx']
+  if (strlen(($motivation = $account->profile_motivation_groupes) < 5)) {
+    $form['action']['report']['profile']['motivation'] = array(
+      '#type' => 'checkbox',
+      '#title' => "Motivation field is senseless: " . $motivation,
+      '#disabled' => empty($key),
+    );
+  }
  if ($key) {
+// add here the new conditions to tell that you have reportable evidences for this user  
-    $evidence_count = count($form['action']['report']['nids']) + count($form['action']['report']['cids']);
+    $evidence_count = count($form['action']['report']['nids']) + count($form['action']['report']['cids'])+ count($form['action']['report']['profile']);
    $form['action']['report']['#description'] = $evidence_count ? t('Select one or more evidences below to report them to www.stopforumspam.com.') : t('This account cannot be reported because no evidence or IP address is available.');
  }
  else {

in function spambot_user_spam_admin_form_submit:

    // Block account
    if (!empty($form_state['values']['block_user'])) {
      if ($account->status) {
        user_save($account, array('status' => 0));
        drupal_set_message(t('Account blocked.'));
      }
      else {
        drupal_set_message(t('This account is already blocked.'));
      }
    }

+// add evidences from "profile" fields
+  // Report to www.stopforumspam.com  
+   $ips = spambot_account_ip_addresses($account);
+   if (!empty($form_state['values']['report']['profile']['motivation'])){
+     if (spambot_report_account($account, $ips[0], "Motivation makes no sense: " . $account->profile_motivation_groupes)) {
+       drupal_set_message(t('IP %ip has been reported.', array('%ip' => $ips[0])));
+     }
+     else {
+       drupal_set_message(t('There was a problem reporting IP %ip.', array('%ip' => $ips[0])));
+     }
+   }
    // Prepare some data
    $nodes = array();    
Tom Ash’s picture

Great, could someone add something like that as a patch for the D7 version?

jvieille’s picture

That is more like a hack. To fit it in the module, it would need to make it configurable, allowing to choose the fields and conditions for the report.

kb8zqz’s picture

We're getting hit with spam user registrations. Profile2 support would be a big help to us.