1
wishcraft
Captcha & GD2 TrueType/Freetype Support

Some of you may have noticed that the captcha is not working on your installations. This is because the FreeType option of GD2 wasn't included when your hosting provider did the compile of it.

Actually they call it 'FreeType' support in GD and GD2, when you compile php you have to use the --enable-gd-native-ttf switch in it's compiling function.

In saying that, I am going to develop a captcha that uses a collection of images rather than fonts, so it runs on all systems.. I am going to release it on phpclasses.org but it will be xoopified for XOOPS here as well.. This will work on all versions that have no font support.. Hopefully you will be able to drop it in to work.
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

2
Runeher
Re: Captcha & GD2 TrueType/Freetype Support
  • 2009/1/16 9:42

  • Runeher

  • Module Developer

  • Posts: 825

  • Since: 2008/1/24


Very much needed as I have these problems with a few hosting providers... A fix for this would be appreciated!!!

On one occation I even had to remove captcha completely as turning it off in config didn't work...

3
ghia
Re: Captcha & GD2 TrueType/Freetype Support
  • 2009/1/18 3:13

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


There is also a text mode selectable in the config.php .

4
wishcraft
Re: Captcha & GD2 TrueType/Freetype Support

The alternative which I think should be used is a method where the http://www.recaptcha.net/ is used and allowed to have a config in XOOPS to set your public and private key.

As this also has audio prompt for disabled people that do not used a telephany keyboard.

Here is how it is done in the interum:

All paths based on XOOPS_ROOT_PATH

Copy recaptchalib.php to /class

Now edit your register.php file as per the following instructions:

echo "";
/*
        xoops_load("XoopsFormCaptcha");

        $cpatcha = new XoopsFormCaptcha();

        echo "".$cpatcha->getCaption().": ".$cpatcha->render();
*/

    
require_once(XOOPS_ROOT_PATH.'/class/recaptchalib.php');
    
$publickey "..."// you got this from the signup page
    
echo "".recaptcha_get_html($publickey);


Then change the final signup stage (finish) to:

/* Rem this part of the code from runtime
    xoops_load("captcha");
    $xoopsCaptcha = XoopsCaptcha::getInstance();
    if( !$xoopsCaptcha->verify() ) {
        $stop .= $xoopsCaptcha->getMessage()."";
    }
*/

    
require_once(XOOPS_ROOT_PATH.'/class/recaptchalib.php');
    
$privatekey "..." // Get from signup page;
    
$resp recaptcha_check_answer ($privatekey,
                                    
$_SERVER["REMOTE_ADDR"],
                                    
$_POST["recaptcha_challenge_field"],
                                    
$_POST["recaptcha_response_field"]);

    if( !
$resp->is_valid ) {

        
$stop .= "The reCAPTCHA wasn't entered correctly. Go back and try it again." .
       
"(reCAPTCHA said: " $resp->error ")"."";

    }
Resized Image
http://www.ohloh.net/accounts/226400

Follow, Like & Read:-

twitter.com/RegaltyFamily
github.com/Chronolabs-Cooperative
facebook.com/DrAntonyRoberts

5
conas
Re: Captcha & GD2 TrueType/Freetype Support
  • 2009/2/6 9:15

  • conas

  • Just popping in

  • Posts: 54

  • Since: 2005/9/5 2


I'm getteing the same thing "Invalid confirmation code!"
and after refresh might let u register might not.
Don't have in pref the turn of captcha either.Don't have XOOPS rootpath.U guys think just get ridof captcha alltogether?
I'm not crazy I'm a hungarian!
http://lsogor.com

6
conas
Re: Captcha & GD2 TrueType/Freetype Support
  • 2009/2/6 9:22

  • conas

  • Just popping in

  • Posts: 54

  • Since: 2005/9/5 2


Tried that and got a blank page.What would be the solution for me?Cause now no one can register on my site.Had to redo the whole site after I installed 2.3.2b with protector, got hacked bigtime because of that script in protector modul.That was a bad idea, who ever put that one into xoops.
I'm not crazy I'm a hungarian!
http://lsogor.com

Login

Who's Online

361 user(s) are online (248 user(s) are browsing Support Forums)


Members: 0


Guests: 361


more...

Donat-O-Meter

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

Latest GitHub Commits