CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Search for spammers who have first name = last name?
Pages: [1]

Author Topic: Search for spammers who have first name = last name?  (Read 1750 times)

Tiffani Chin

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.30
  • PHP version: 5.3.17
Search for spammers who have first name = last name?
January 10, 2013, 10:45:15 am
My first CiviCRM enabled site was password protected and works brilliantly-- and then I naively left my second, public, site very vulnerable to spammers.

I have gone through and manually deleted thousands of fake Drupal Users and their comments.

But of course, these "people" all have CiviCRM records too. 

The vast majority of them have the same first name and last name.  So I'd love to do a search of first name=last name and bulk delete but can't find a good way in the UI to do so.

I can do this in the database, but I wonder if deleting users in that way will mess up others things.

Does anyone have any advice?

BTW -- we're using Drupal's Mollom module now and it has made a tremendous difference in keeping out the spammers.  Fingers crossed that it keeps up.

Thanks in advance!
-tiffani

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Search for spammers who have first name = last name?
January 10, 2013, 11:07:16 am
Hi. It is definitely not recommended to just delete contact records via SQL. Perhaps you could write a custom search to find these records. If not, you could write a bit of custom PHP code to find the records and then delete them via the API. That would be the correct way. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Jason W

  • I post frequently
  • ***
  • Posts: 197
  • Karma: 12
  • jason@civitrainingtutorials.com
  • CiviCRM version: 4.2
  • CMS version: Drupal 7
  • MySQL version: 5.x
  • PHP version: 5.x.x
Re: Search for spammers who have first name = last name?
January 10, 2013, 11:52:45 am
Hello tiffani,

My suggestion would be to Use the advanced search's ability to search for contacts that were added during a certain time period. Go to advanced search and expand the change log accordion. Now set the range to the period starting with the added date of the first 'spammer', to today's date. you still have to weed through a few contacts, but at least you can select them, then delete the selected from the actions menu.

Cheers,
Jason
civiTrainingTutorials
"Helping You Help Others"

Tiffani Chin

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.30
  • PHP version: 5.3.17
Re: Search for spammers who have first name = last name?
January 10, 2013, 03:55:22 pm
Thanks to you both.

Hershel -- No matter how many online PHP tutorials I do, my skills do not keep pace with my desire to program!  But, this gives me further motivation to be able to do it "the right way."  Thanks for confirming that I should not delete from the database.  I was so tempted.

Jason W -- thanks for the newbie friendly suggestion.   I guess I have some searching and clicking to do!

Thanks.

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Search for spammers who have first name = last name?
January 15, 2013, 04:09:34 am
Tiffani had a good idea here, so I posted a custom search for individuals with first_name = last_name here.  Hope others find it to be useful.

Tiffani Chin

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.26
  • MySQL version: 5.5.30
  • PHP version: 5.3.17
Re: Search for spammers who have first name = last name?
January 18, 2013, 02:17:10 pm
Wow -- robinhood, you're amazing! 
Haven't tried it yet but excited to!

Also going to scope your code.  Would love to be able to write a custom search.

Thanks!

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Search for spammers who have first name = last name?
January 18, 2013, 08:41:27 pm
Nothing amazing about it.  I found that writing a custom search is really quite easy and useful.  If I can figure out how to turn it into an extension, that would be better.

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Re: Search for spammers who have first name = last name?
April 17, 2014, 09:23:54 am
@robinhood, do you have this code working for 4.4? I just tried to install it but get this:
Code: [Select]
Fatal error: Declaration of CRM_Contact_Form_Search_Custom_SpamNames::all() must be compatible with that of CRM_Contact_Form_Search_Interface::all()...
I'm not sure if it's due to changes from 4.2 to 4.4?
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

robinhood

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 6
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.56
  • PHP version: 5.3.5
Re: Search for spammers who have first name = last name?
April 17, 2014, 07:08:30 pm
The version for Civi 4.4 is here.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Search for spammers who have first name = last name?

This forum was archived on 2017-11-26.