1
Catzwolf
Xoops reCaptcha Class v1.00 beta
  • 2010/7/25 4:59

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


What is Xoops reCaptcha?

Xoops reCaptcha is class that will allow users to add and use reCaptcha widget to prevent spam being posted on their website.

This class can be used in conjunction with the Xoops Captcha or it can replace it all together, with just few lines of code.

While this class can be utilized by anyone, it is aim more at Xoops developers wishing to add reCaptcha to their code.

The class is cleanly written and has developer comments to help aid you in it's usage and there is also documentation within the package that will explain how to add the required calls to make it work.

For its usage, you will be required to create a private and public key and these can be entered one of two ways (Again, this is explained in the documentation).

Xoops reCaptcha, can be used in two ways, either within XoopsFormclass or statically through its own API and methods.

There are examples of its usage within the documentation.

Xoops reCaptcha v1.00 is beta and should not be considered ready for a production website, but used to help with further development.

While I have tried to make this as easy to use as possible, it is not for total beginners. If you require help with this class, I am sure people here will only be to glad to help out.

You can download this class from the following:
Xoops reCaptcha v1.00

Please submit bugs and features here:
bugs and feature requests

2
Mamba
Re: Xoops reCaptcha Class v1.00 beta
  • 2010/7/25 6:17

  • Mamba

  • Moderator

  • Posts: 11264

  • Since: 2004/4/23


Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

3
webmystar
Re: Xoops reCaptcha Class v1.00 beta
  • 2010/7/25 7:24

  • webmystar

  • Friend of XOOPS

  • Posts: 415

  • Since: 2008/6/23


Thanks for your work, catzwolf. I will it testing soon.

4
trabis
Re: Xoops reCaptcha Class v1.00 beta
  • 2010/7/25 11:48

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Thank you :)

5
Defkon1
Re: Xoops reCaptcha Class v1.00 beta
  • 2010/8/25 11:06

  • Defkon1

  • Not too shy to talk

  • Posts: 151

  • Since: 2005/1/27


I'm trying to use your reCaptcha class in comment form, without success.

Following the readme.doc I copied your hacked core files and reCaptcha class to my server; so, I modified /include/comment_form.php (around line 92):

$cform->addElement(new XoopsFormCaptcha());   //original


in

$cform->addElement( new XoopsFormRecaptcha$caption$privatekey$publickey ),true );   //hack


Actually the reCaptcha widget is correctly shown (see attachment), but it doesn't perform any validation.
I tried with wrong code and even left blank, but the form is submitted anytime...

what's wrong?

thanks in advance

Resized Image


6
Defkon1
Re: Xoops reCaptcha Class v1.00 beta
  • 2010/8/25 13:40

  • Defkon1

  • Not too shy to talk

  • Posts: 151

  • Since: 2005/1/27


i solved this way:

1- modified formrecaptcha.php

$this->reCaptchaHandler->setKeys$private_key$public_key );

changed in
$this->reCaptchaHandler->getConfig();


2 - recaptcha.php, line 135 changed

$this->setError$response->getError() );


in
$this->setError"empty-recaptcha" );


3 - comment_post.php in the "post" case (around line 146) added

//DFK   
      
require_once XOOPS_ROOT_PATH '/class/recaptcha.php';
      
$xoopsRecaptcha =& XoopsRecaptcha::getInstance();
      
$xoopsRecaptcha->getConfig();
       if (! 
$xoopsRecaptcha->doValidate() ) {
        
redirect_header($redirect_page '=' $com_itemid '&com_id=' $com_id '&com_mode=' $com_mode '&com_order=' $com_order1$xoopsRecaptcha->getErrors(true));      
       }
       
//DFK

Login

Who's Online

31 user(s) are online (17 user(s) are browsing Support Forums)


Members: 0


Guests: 31


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits