This object is in archive! 

Spam Bot Protection

Archived Alexander K. 12 years ago

Hi there,


we had massive problems with bots the last few weeks - we had 50 registrations with names like "watch my wife here". This looks really ugly if one is surfing through the user list. For now we made a little hack, maybe this could make into the core. It uses recaptcha, but using the default zend captcha would do the trick as well.


Class System_Form_Registration, added to init:


  1. $publickey = 'enterpublickeyhere';
  2. $privatekey = 'enterprivatekeyhere';
  3. $recaptcha = new Zend_Service_ReCaptcha($publickey, $privatekey);
  4. $captcha = new Zend_Form_Element_Captcha('captcha',
  5. array(
  6. 'id' => 'captcha',
  7. 'label' => 'Validation',
  8. 'captcha' => 'ReCaptcha',
  9. 'captchaOptions' => array('captcha' => 'ReCaptcha', 'service' => $recaptcha),
  10. 'ignore' => true,
  11. 'decorators' => array(
  12. 'ViewHelper'
  13. )
  14. )
  15. );
  16. $this->addElement($captcha);

As the view renderer will not just render that, the following is needed for auth.phtml:


  1. <?php elseif($element->getType() == 'Zend_Form_Element_Captcha'):?>
  2. <?php echo $element->render()?>

After that I just tweaked the css a little to have a bigger registration form. That's it - after that registration needs recaptcha and the bots can no longer register.

Best Answer
photo

Alexander,

Thank you for sharing the solution with captcha. We'll consider it, but not guarantee that implement it, unless we are sure it's the best method to protect from invalid registration

Replies (4)

photo
1

Alexander,

Thank you for sharing the solution with captcha. We'll consider it, but not guarantee that implement it, unless we are sure it's the best method to protect from invalid registration

photo
1

No problem, i will stay with the hack until you have another solution to this.

photo
1

Hi there,


It would be nice to have a supported solution for this, we have over 30 malicious registrations daily and as you can imagine, this is quite frustrating...


A simple captcha will really do the trick in most cases.

photo
1

We'll improve the system. Now there is protection in 2.3.1 corporate release

Replies have been locked on this page!