Google ReCaptcha reload button does not work in Joomla 1.5

377 views Asked by At

I'm working in an implementation of ReCaptcha from Google in my Joomla 1.5 application. I know, it's an old version of Joomla, but as the time got passed, the hard code practice at the company made the upgrading impossible.

I found an old ReCaptcha plugin for Joomla 1.5 at https://code.google.com/p/joomla-recaptcha/, by the way, recommended by developers.google (https://developers.google.com/recaptcha/old/intro).

That plugin is really simple to use. Enough to install the plugin and enable it. This way it's only a matter of use its static methods. One thing I had to do was change the path to the ReCaptcha ajax API, both in components/com_community/helpers/recaptcha.php and in plugins/system/recaptcha/recaptchalib.php. That's because the plugin reference the old path.

I'm working well with server side part of ReCaptcha. So I'm mostly concerned with a client-side issue. To display ReCaptcha snippet, is only a matter of include the line

<div><?php echo ReCaptcha::get('html'); ?></div>

in the template .php.

The ReCaptcha::get static method generates the following piece of code in my template

<div>
    <div id='recaptcha_ajax_instance_'></div>
    <script type='text/javascript' src='http://www.google.com/recaptcha/api/js/recaptcha_ajax.js'></script>
    <script type='text/javascript'>
        (function(){
            function loadRecaptcha(){
                Recaptcha.create('6LcKaAgTAAAAAP3CgGF04VUsWTPGwzDs3EaVlajH','recaptcha_ajax_instance_');
            }
            if( window.addEvent ){
                window.addEvent('domready', loadRecaptcha);
            }
            else{
                if( window.addEventListener ){ window.addEventListener('load', loadRecaptcha); }
                else if( window.attachEvent ){ window.attachEvent('onload', loadRecaptcha); }
                else{ old = window.onload; window.onload = function(){ if( old && typeof old == 'function'){ old(); } loadRecaptcha(); }; }
            }
        })();
    </script>
</div>

That issue is simply the button to reload captcha doesn't work. Neither mouse changes to pointer when hovering button, nor button change the words when clicked. The two other buttons (audio chalange and help) work well.

I wondering if the code above is outdated with the most updated API in google URL.

Goggle's recaptcha

If somebody could help, I appreciate.

0

There are 0 answers