Home
Sat
24
Jun

JCCreCaptcha Plugin

Attention: open in a new window. PDFPrintE-mail

 

Instalattion and Setup

 

Because I don't founded a Joomla 1.5 plugin for reCaptcha, the solution was to develop one!

 

In fact, we use the yvComment to add support for users comments on our pages. Because this we was looking for a plugin that easily integrate with it. Soon, we based our interface on OSTWigits-Captcha plugin's interface.

 

The installation is the same for any Joomla 1.5 plugin, on Joomla's administrative site, follow the next steps:

 

1. Run the Install / Uninstall comand of Extensions menu:
 
Comando Install / Uninstall do menu Extensions
 
 
2. On "Extension Manager" interface, browse for the "JCCReCaptcha1.0.zip" plugin's file, in the "Upload Package File" field:
  
Selecionando o pacote para upload e instalação
 
 
3. After installation, will be showed the following success message:
 
Sucesso na instalação do JCCReCaptcha 1.0

 

Then, the plugin needs to be enabled and setuped with the key pair (public and private), that will to give access to the reCaptcha service. If you haven't this key-pair, sign on reCaptcha site, aqui, tho give it.

 

With your key-pair on hands, open plugin's parameters interface and insert or copy and paste, each key on it's respective field, then save at end!

 

Par de Chaves

 

Through the Theme and Language Name parameters, we can to select one of pre-defineds reCaptcha widget interace designs, as well one of it's supported languages.

 

Don't forget to enable the plugin!

 

Habilitando
 
 
 

Putting a reCaptcha on your site

 

The reCaptcha differs of OSTWigits-Captcha. OSTWigits-Captcha produce a single image to be getted on one IMG html tag, while the reCaptcha generate a full html interface with yourself design, buttons to audio Captchas (!), buttons to change / update the Captcha image and a textbox to user insert a captcha interpretation.

 

Whatever, the principle of to load the plugin's output on a IMG html tag don't work! Instead, the output of plugin's method “display” need to be rendered on page like a html snipplet, just in forms place where the captcha needs to be edited. So, we can use on of the options down:

 

Using the plugin's display() method:

 

<?php
       plgSystemJCCReCaptcha::display();
 ?>

 

or, using trigger, what will to use the functionality without to have to especify a plugin on code:

 

<?php
       Global $mainframe;
       $mainframe->triggerEvent( 'OnCaptcha_Display');
 ?>

 

 

Validating the User Captcha Interpretation

 

The validation is very simple. All that you have to do is to append one of the following validation code on the form validation logic:

 

<?php
      If ( !plgSystemJCCReCaptcha::confirm() )
            echo "It's wrong!<br>";
 ?> 

 

or, trigger form:

 

<?php
      global $mainframe;
      $return = false;
      $mainframe->triggerEvent( 'OnCaptcha_confirm', array(null, &$return));
      If ( !$return )
            echo "It's wrong!<br>";
 ?>

 

 

Downloads & Article's Links

 

The software is available "as is". No warranty, or support will be provided. The software is available on the terms of GNU-GPL license. Know its terms here.

 
 
Joomla 1.5 Plugin for use reCaptcha on your site!
 
 
 
 

Relacted

 

Upgrade: JCCreCaptcha 2.0b
The "no-code" solution to integrate reCaptcha with any formulary!  

 

Upgrade: JCCreCaptcha 1.01
This upgrade enable the JCCreCaptcha plugin to be used with the core Joomla contact component, com_contact.
ATTENTION: It is only required if you want to use reCaptcha with com_contact!

 

Using JCCReCaptcha with yvComment
How to adapt the yvComment component to use JCCreCaptcha (code sample).

  
 
 
 

About the Author

 

Júlio Oliveira
Júlio Oliveira is System Analyst with lato-sensu degree in Software Project Management by PUC/Rio. He have experience of 20 years in enterprise software development, of which 10 years, working on national and international insurance companies, currently, he is TI consultant and website developer.
 


Adicionar este artigo ao seu site de favoritos ?
Digg! Reddit! Del.icio.us! Google! Live! Facebook! Technorati! StumbleUpon! MySpace! Netvouz! Mister-Wong! Diigo! Faves! Ask! DZone! Swik! Twitter! LinkedIn!

Comments (33)
33 Tuesday, 16 February 2010 14:46
Zaner
I installed, enabled the plugin, configured it with recaptcha keys the plugin, but it does not show on my site:
http://www.estudioabierto.com.uy/es/contacto-estudio-abierto/12-contactos/3-estudio-abierto.html
Can you please tell me why? I saw the video:
http://www.youtube.com/watch?v=tn8v0GqCS1c
It mentions Contact-JCCReCaptchaCV but I do not see it on my plugin list.
32 Monday, 04 January 2010 16:18
Brian
I am a coder and I am a bit confused about the differences in versions.

I am under the impression that version 1 needs some code add ons. Could someone tell me which files?

This is a basic native Joomla install registration form.

It sounds like Version 2 is more plug and play? When I look at the extensions it appears code also needs to be added. Am I missing something?

Thanks
31 Friday, 18 December 2009 05:25
Mike
Julio:
I installed 2.01 and everything seems to be working fine, with one exception. As background, I installed it for virtuemart so the settings in blocked tasks are different than in joomla registration. I used "com_virtuemart,shopperadd" so I hope those are right. Virtuemart registration overrides joomla, in fact the joomla registration must be disabled. There are also no menu items for virtuemart registration, as near as I can tell. In order to get the module to work I linked to my "Store" menu item. However, on my main store page the captcha dialogue box sits at the very bottom of the page. How should I work around that to get it off of that page. Take a look at www.tentpak.com.
Thanks for a great item.
Mike
30 Sunday, 13 December 2009 13:32
Windymelt
I've used this plug-in just now.
Thanks a lot.
29 Friday, 11 December 2009 17:58
Eddie
Nice!

very well done. this beats acontact out of the water!
28 Friday, 04 December 2009 09:12
julienv
Hi Julio,

I like our plugin, i wanted to use it for registration captcha. Putting the code to generate the captcha can be done in a template override, preventing it to be removed when upgrading joomla, but for the verification, it's not possible (it has to be done in com_user controller, which is erased on upgrade).

hence, here is a function you can add in the plugin to trigger the check directly from the plugin:


public function onAfterRoute()
{
global $mainframe;

$app = JFactory::getApplication();
if ('com_user' == JRequest::getCMD('option') && !$app->isAdmin() && JRequest::getVar('task') == 'register_save')
{
if (isset($_POST["recaptcha_challenge_field"]))
{
if ( !$this->confirm('') ) {
$app->redirect('index.php', JText::_('CAPTCHA DO NOT MATCH'), 'error');
}
}
}
}
27 Sunday, 15 November 2009 20:16
Samuel
I am having a very hard time trying to understand where to start. Is there anyone in the States who can better explain this to me step by step. where to put which peace of code where and so forth.....please. thanks sam

*** Admin Answer ***

Hi Sam!

Try the JCCreCaptcha 2.01b release. It was made to non-PHP coders!

Thanks.
26 Monday, 09 November 2009 18:03
Alessandro
I installed your plug in to protect Joomla registration form index.php?option=com_user&task=register, I can see now the images with the words to type, but I don't understand where to put validation code, could u clarify where to put, in which page I have to pute the code to validate the word typed ?

Thanks in advance, Alessandro.

*** Administrator Answer ***

Try the 2.0b release. The links are on the page!

Thanks!
25 Monday, 02 November 2009 19:54
Administrator
Hi Sylvain,

The 2.0b release is relying on JRequest instead $_POST, like you recommend.

Thanks!
24 Friday, 30 October 2009 10:55
Sylvain
I come back to you to tell you that there is a security hole in your code with JCCreCaptcha 1.01 : replace in jccrecaptchacv.php these lines:

$session->set('contact_name', $_POST['name']);
$session->set('contact_email', $_POST['email']);
$session->set('contact_subject', $_POST['subject']);
$session->set('contact_text', $_POST['text']);

by these lines

$session->set('contact_name', JRequest::getVar('name', '', 'post', 'string'));
$session->set('contact_email', JRequest::getVar('email', '', 'post', 'string'));
$session->set('contact_subject', JRequest::getVar('subject', '', 'post', 'string'));
$session->set('contact_text', JRequest::getVar('text', '', 'post', 'string'));

The previous lines clean eventual non desired code coming from an hacker.
23 Sunday, 25 October 2009 14:47
Camilla
Thanks for this plugin! Easy to make it work with YVComment by following the instructions. I have a bilangual site, using M17n. Did put the plugin into English as standard. How does it work with my Dutch site?
Thanks for letting me know

PS: you are not using your captcha?
22 Tuesday, 13 October 2009 12:41
NUBIX
hi Júlio,

Do you mind to tell us exactly when the 'no code integration release' will be published ? as I can't use your plugin till now.

many thanks for your great work.
Administrator's reply:
Sunday, 17 January 2010 00:12
Tom
Can I change the order?
The newest tweet disappear in a few seconds.

Can I limit the tweets?
Sunday, 25 October 2009 07:27
Where is the validation Registration Form ?
Julio

I would like to use your code for captcha in joomla, where is the place to put the validation code ?

Thanks in advance.
21 Tuesday, 13 October 2009 12:22
Sylvain
Here is a fix to allow secure connection to reCaptcha. I provide just a small part of code. To provide the rest I don't know how. No Forum, no contact formular. What a pity!

function display()
{
...
// You have to define a param sslSecure in the jccrecaptcha.xml
$ssl = $params->get( 'sslSecure', false );

....
echo recaptcha_get_html( $publicKey, null, $ssl );

return true;
}

You save all then you configure your plugin in the backend to activate the new param to yes.
More info contact me to the website www.diglin.com
Administrator's reply:
Tuesday, 09 February 2010 20:17
W Ty
alguem teria esse módulo para joomla 1.0?
20 Friday, 09 October 2009 02:13
schizzore
hello anyone, i would like to ask the integration w/ virtuemart registration form.
it successfully displayed but even when i put the code incorrectly it said "registration complete"
where should i put this

global $mainframe;
$return = false;
$mainframe->triggerEvent( 'OnCaptcha_confirm', array(null, &$return));
If ( !$return )
echo "It's wrong!";

or should i use this

If ( !plgSystemJCCReCaptcha::confirm() )
echo "It's wrong!";

please help somebody, thx
19 Friday, 02 October 2009 22:34
but where is the download button?
Hi, I try to download this plugin, but I see no button for it nor for upgrade 1.01. Where can I get it please?
Thanks Marc
Administrator's reply:
Monday, 05 October 2009 14:43
Administrator
Hi,

There are a donwload section on each extension article. There are too a menu option named "Download", at right side of the page. By both paths you can download any extension!

Thanks.
18 Thursday, 01 October 2009 06:27
Lippi
Hello, could You tell me what I did wrong?

I made all hacks in two files and it doesn't matter what I write in the captcha. It always shows Invalid Token, even if it's correct.
Administrator's reply:
Thursday, 21 January 2010 03:11
shanique
Hi, Thanks for this. But ONE suggestion: Could you please put all the downloads on ONE page, I've been hopping around like mad, to get all the zips files ;-))
Saturday, 16 January 2010 19:45
ssnobben
Viva Brazil! Thanks for continuously working with this great Joomla addon!
Saturday, 16 January 2010 15:21
Zoltan from Hungary, Europe
This extension is the one that I am looking for. When will you solve the mentioned limitations?

Unfortunately, it is unusable without support of menus, titles, meta tags. I need to be able to develeop a fully multilingual site.

Joomla 1.5.15 is the latest version, currently.
Wednesday, 06 January 2010 17:53
Michael
sounds great! Keep up the good work, because JoomFish sucks!!! ;-)
Saturday, 02 January 2010 23:19
tarig
does it support Arabic language?
www.hiwaar.com

-------------------------------

Admin Answer:

I don't know, but - since Joomla support it - the extension will support too!

Thanks!
Saturday, 05 December 2009 21:58
mario
hello, very nice solution, but I have found 2 errors. First the language selection module go ever to the home page if I choose a language. Is there not a possibility to display the translated current page?
Second the order of the articles in the second language of the front page blog layout is ever the default order. Not the order which I have defined. In the first language the order is okay. I have used
Category Order: Order
Primary Order: Order
Multi Column Order: Down
Sunday, 22 November 2009 04:36
flow
nice one, but where's the advantage/unique feature towards joomfish?
Wednesday, 04 November 2009 13:39
Vladimir
Hi! It seems it works fine on your site for Porto/Eng modes... what about other languages? I am searching for a rus/eng solution. Thanks.
Tuesday, 20 October 2009 07:17
Antonio
hello, i am trying to use your pack for a bi-lingual portal for my univ project. however i cannot integrate languages for the front end. ok at the backend, but that i do not need. when i install other "admin" languages, it is ok they appear in the "JCC" component multilanguage filter. But "site" languages for front end do NOT appear in the drop down. When I go in the normal article manager I get all languages installed displayed in the content language drop-down. Both plugins are installed first in their respective content & system classes. Can you help me please cos your component seems to work just fine and i'm sure this is a small hitch. Thanks
Wednesday, 09 September 2009 07:48
randomb
wow, sounds very promising!

Thanks for your work, keep on rocking ;)
17 Tuesday, 22 September 2009 11:06
Ricardo Cristof Remmert-Fontes
Hi,

could you please explain how to integrate this into the standard joomla contact form?

Best regards,
ricardo Cristof
Administrator's reply:
Tuesday, 22 September 2009 23:27
Administrator
Hi Ricardo,

For Joomla core contact component, you can use the JCCreCaptcha release 1.01. It is explained and can be downloaded from the "Upgrade: JCCreCaptcha 1.01" article.

Thanks.
16 Friday, 18 September 2009 11:41
Spud
Thanks for the plugin Júlio - I've managed to get it to work but there was a small problem with the code which I had to fix.

In plugins/system/jccrecaptcha.php:

change
function confirm($word)
to
function confirm()

For those people who want to add a captcha to the user registration form the changes that worked for me were

In components/com_user/controller.php, to the register_save() function after the "403 not authorized" section add:

if ( !plgSystemJCCReCaptcha::confirm() ) {
print "Error: " . "Please enter captcha phrase";
JError::raiseWarning('', "Please enter captcha phrase");
$this->register();
return false;
}

To components/com_user/views/register/tmpl/default.php:

Add plgSystemJCCReCaptcha::display(); (in php tags) where you want the captcha.
Administrator's reply:
Friday, 18 September 2009 13:18
Administrator
Hi Spud,

You're right! The "$word" argument is only needed for compatibility with the OSTWigits-Captcha interface. It was done to easy the integration with yvComment, that use OSTWigits-Captcha interface like component.

Thanks.
15 Thursday, 17 September 2009 11:21
NUBIX
hi,

I have installed you Plugin & I read the reviews on this page and I still can't use it.

Could you explain in more details ? (note that I'm not a php coder).

Thanks in advance.
Administrator's reply:
Thursday, 17 September 2009 18:43
Administrator
Hi NUBIX,

Really, for a non PHP Coder, can be a little difficult understanding exactly how to do the integration. The good news is that we plan to post the release with 'no code integration', in this week. It will be a better solution.

Thanks.
14 Wednesday, 16 September 2009 20:11
iapad
Where do I find the GUI form?
Administrator's reply:
Thursday, 17 September 2009 04:12
Administrator
Hi iapad,

The 'GUI form' is the html form or page that you use to get any data from your users and you want to protect from bots, using a reCaptcha.

Since you can configure the JCCreCaptcha by code on any place, you can to use on any Joomla form, core or third parts, since you get access to its source code!

PS: The "no code" solution is on test fase. Soon it will be released!

Thanks
13 Wednesday, 16 September 2009 16:22
sakis
Hi

thanks for the extension
i did the above hacks for the com_user

the captcha appears in the registration form but it does not validate.

I entered the validation code in com_user/controller.php save function.

Is this the correct place?
Plz help
Administrator's reply:
Thursday, 17 September 2009 04:06
Administrator
Hi sakis,

Yes, it is!

Try to implement the answer when reCaptcha return false, like on "do a password safety check" code, on controller save method. Notice that on password check, when wrong, it get a text for message, get the request URL and use setRedirect to do both things, to return to the URL that originated the request and to set the error message gotted before.

The same things will be the answer when the Captcha is wrong.

Thanks
12 Tuesday, 15 September 2009 20:55
Michael
Okay i'm totaly lost here. Can you tell me where I have to change the lines ? (/compontest/blablalba/123 eg. ) As you can se on www.iguy.dk it dossent work ;).

// Sorry my bad english ;)
Administrator's reply:
Wednesday, 16 September 2009 03:11
Administrator
Hi Michael,

It will depend of where you want to use JCCreCaptcha (what component will be protected with the Captcha ?). Generally it will be like follow:

1) The first PHP code, one of the two on "Putting a reCaptcha on your site" article section, must be inserted on the view code portion of your GUI form (just on place that you want to see the reCaptcha widget, on your GUI form), normally a php or html file that will to render your GUI form.

2) The second PHP code, one of the two on "Validating the User Captcha Interpretation" article section, must be inserted on the PHP validation input code for its GUI form.

I Hope to helped! Thanks!
11 Tuesday, 15 September 2009 20:28
Theo
Hi,

I manage to integrate recaptcha in the register page but I do not find where to place the code of validation.

Thank you a lot, and great job ;)
Administrator's reply:
Thursday, 17 September 2009 04:16
Administrator
Hi Theo,

The place for com_user is "components/com_user/controller.php", (site directory), on the method save().

Good news! The 'no code' solutions is on test fase. Soon it will be released!

Thanks.
10 Monday, 14 September 2009 04:52
user reg form
how can we make it also protect the user registration form?

is this possble - please detail steps

thank you very much for the good work
Administrator's reply:
Monday, 14 September 2009 12:03
Administrator
Hi,

You can do it making a hack on user registration form. Please refer to the articles "JCCreCaptcha Plugin" and "Using JCCreCaptcha with yvComment" that explain all information to use JCCreCaptcha programmatically.

If you can to wait, we are working on a "no code" solution, like previewed on release 1.01, on article "Upgrade: JCCreCaptcha 1.01", it will be released soon.

Thanks
9 Sunday, 13 September 2009 19:21
Wangming
Hi
This is really a good application. My questions are:
1. Can we take a sound button out? Because, a)It dose not really sounds good. b) I am using it for my Chinese, it is very hard to understand the sound; c) when press sound button, the image goes away and cannot go back to the image page.
2. The help page is in English. Can we take that button out?
Other then that, it is working good.
Thanks,
Administrator's reply:
Sunday, 13 September 2009 20:27
Administrator
Hi Wangming,

Yes, we can! Both requests will figure on the list of the next improvements!

Thanks,
8 Wednesday, 09 September 2009 17:27
Ted Pruitt
This plugin is fantastic! Have you thought about adapting the plugin to work with Mad4Joomla's form software (the captcha they use is very weak).

Just a thought - thank you so much for your work.

abraços - Ted
7 Saturday, 05 September 2009 20:27
Help
What file do I insert that php code into?
Administrator's reply:
Sunday, 06 September 2009 13:22
Administrator
The first PHP code, one of the two on "Putting a reCaptcha on your site" article section, must be inserted on the view code portion of your GUI form (just on place that you want to see the reCaptcha widget, on your GUI form), normally a php or html file that will to render your GUI form.

The second PHP code, one of the two on "Validating the User Captcha Interpretation" article section, must be inserted on the PHP validation input code for its GUI form.

I Hope to helped! Thanks!
6 Saturday, 05 September 2009 14:03
samuel
where do i insert those php code above. i am confuse
Administrator's reply:
Saturday, 05 September 2009 17:38
Administrator
Hi Samuel,

Because there aren't a Captcha standard interface that will to permit a Captcha component to be used anywhere with anyone GUI form, We should need to use these codes to attach our captcha component to a desired (including a custom) GUI form.

There are a sample of how it can be done, on article "Using JCCreCaptcha with yvComment", here on blog.

If you plan to use the reCaptcha with Joomla core com_contact components, you can use the revision "1.01". It have a "inject itself" behaviour that don't require the use these PHP codes but, for now, it only works with a contact e-mail form of Joomla core com_contact component.

We can to get it on "Upgrade: JCCreCaptcha 1.01" article, here on the blog, too.

Thanks,
5 Saturday, 29 August 2009 13:32
Nikosjoomla
Can i use the plugin to the core contact component of joomla?
Administrator's reply:
Saturday, 29 August 2009 16:36
Administrator
Hi Nikosjoomla,

Since JCCreCaptcha isn't a contact plugin, it can´t be used with contact component on a "Plug and Play" basis, but you can easily make use of the triggers call code showed on article to adapt it on the Joomla contact core component.

On a quickly view, the Joomla contact core component plugins interface don't have a event to customize the contact form, so, seems that we have to edit the contact form to do this.

Anyway, your question will figure on top of the future improvements list.

Thanks!
4 Friday, 28 August 2009 22:24
Winchester
Also, this links on your download page are not working for UK English.

You might want to allow more characters for your comments. I have to make 3 posts to say what I wanted to.
Administrator's reply:
Saturday, 29 August 2009 16:05
Administrator
Hi Winchester,

Thanks for yours posts! We extended the comments post limit. The UK Links on download page were fixed, as well, and we are working to fix the "zip / htm" misplace!

Thanks,
3 Friday, 28 August 2009 22:22
Winchester
One problem though. When I click on the link to download the plugin, it gave me "JCCReCaptcha1.0.htm". Anyways, I download the "htm" file and renamed it to "JCCReCaptcha1.0.zip" and it worked.
2 Friday, 28 August 2009 22:21
Winchester
I have been waiting for a long time for an extension for reCaptcha. Thanks.
1 Friday, 28 August 2009 16:17
Jerry
Does it work with Virtuemart
Administrator's reply:
Saturday, 29 August 2009 15:51
Administrator
Hi Jerry,

I didn't tryed to use it with VirtueMart, but it is working fine on all contexts where we can use triggers call to its interface, like showed on article. If you have problems, make me know to try to fix the ocurrence!

Thanks,

Add your comment

Your name:
Comment:

Menu Principal

Editar traduo para English (United Kingdom) Editar traduo para Português (Brasil)
Blog Sistemas e Cia