3

Rather then adding a custom solution, the way I am building the component tries to use Joomla API's and such as much as possible. If the same could be done for Captcha that would be extremely beneficial.

The default Captcha can be set in the global configuration, however some searching has turned up nothing on how to use that in a third party component.

5

As far as I know there isn't any sort of default captcha in Joomla's API. The only captcha options available are a core plugin, which is ReCaptcha as @Lodder mentioned. Incorporating that plugin as about as core API as you can get I believe.

That said, the way you use that plugin is by using the plugin event for Captchas. This way any other captcha plugin configured by the CMS admin will be used, no matter what it is.

The method to do that is explained very well here:

https://stackoverflow.com/questions/12840015/how-to-use-joomla-recaptcha-plugin-to-my-custom-module

Here's some sample code I wrote using the method described there:

1) The view https://github.com/drmmr763/com_authorize/blob/master/components/com_authorize/views/authorize/tmpl/default.php#L78

2) Overridden controller with checkCaptcha function: https://github.com/drmmr763/com_authorize/blob/master/components/com_authorize/controllers/authorize.php#L117

And then I call that function in my pay() method: 3) https://github.com/drmmr763/com_authorize/blob/master/components/com_authorize/controllers/authorize.php#L48

Hope this helps!

1

Before you do anything, ensure you're running the latest version of Joomla as Google changed the location of the ReCaptcha library which meant that all sites using the integrated ReCaptcha failed. It was temporarily disabled in Joomla 3.2. I'm not sure on the exact version it I'm sure it will work with Joomla 3.2.4 and above

To integrate Joomla's built in ReCaptcha, have a look at the following documentation which provides a good guide:

http://docs.joomla.org/How_do_you_use_Recaptcha_in_Joomla%3F

  • This is more for development, not admin configuration. I plan on adding captcha to a form component we are working on, however rather then our own solution like most developers go for, we have been trying to keep to Joomla's core API's as much as possible. – Jordan Ramstad May 15 '14 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.