Author Topic: [SOLVED] block SPAM registrations. . .  (Read 47198 times)

HelloMcFly

  • Beginner
  • *
  • Posts: 25
Re: [SOLVED] block SPAM registrations. . .
« Reply #45 on: November 23, 2012, 06:22:49 am »
Hi all,
I haven't posted here in a while because I had to stop using virtuemart.  (I ended up using IXXOCART for the multi-vendor features) 

I needed to implement a similar "name" = "username" check on the Joomla registration flow once I switched from virtuemart.  You can see my latest post about that on the joomla forums here:

http://forum.joomla.org/viewtopic.php?f=624&t=691707

Just a couple of comments based on the feedback above:

1. Now that I've gained a little more experience in PHP I see that STINGA is right.  You would need to implement the check outside of the GUI, and do the check on the page that actually performs the registration.  This will prevent Hackers/SPAMmers from posting data directly to that page.

2.  A few people above changed the code above so that the error message told the SPAMmers why the registration didn't work.  Then they began getting SPAM registrations with random strings.  As stated earlier, I think it's best that you don't get too descriptive with your error message.  You want humans to be able to register, but you don't want to give SPAMBOTS enough info to circumvent your checks above.  I think an error like "Performing Maintenance" or "Contact Dan" works well!

I may switch back to virtuemart once the multi-vendor features are added, but for now I can't comment on later versions of virtuemart.  I will be more than happy to try and help when possible though.  Thanks for all the great feedback.

Warm regards,
Dan Yager
aka HelloMcFly and Quickheads
;-)




mattcowan

  • Beginner
  • *
  • Posts: 3
Re: [SOLVED] block SPAM registrations. . .
« Reply #46 on: August 11, 2013, 05:36:26 am »
This thread kept coming up in the search results for when I was trying to solve this same error in VM2, so I figured I would post this here.

To implement this solution in vm2, you are going to want to edit public function store() in administrator/components/com_virtuemart/models/user.php

Add this code:
Code: [Select]
if($data['first_name'] == $data['last_name']) {
vmError('Spam');
$mainframe->enqueueMessage('This triggered the spam filter. If this is preventing you from placing an order, please call customer service.', 'error');
return false;
}
I added it below the check to see if data was empty, near the top of the function, so my file looks like this:
Code: [Select]
if(empty($data)){
vmError('Developer notice, no data to store for user');
return false;
}
//Original Idea By Dan Yager to prevent SPAM, modified by Matt Cowan
                   // Dan Yager = www.quickheads.com
if($data['first_name'] == $data['last_name']) {
vmError('Spam');
$mainframe->enqueueMessage('This triggered the spam filter. If this is preventing you from placing an order, please call customer service.', 'error');
return false;
}

rage76

  • Jr. Member
  • **
  • Posts: 125
Re: [SOLVED] block SPAM registrations. . .
« Reply #47 on: May 05, 2014, 19:29:08 pm »
Dear Mattcowan

Were you able to take care of the spam registrations in Virtuemart with this hack? If yes, can you please guide me through this?

best regards