Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 2
Joined: Thu Feb 12, 2009 5:47 am


Postby kmlawson » Thu Feb 12, 2009 5:54 am

I understand you have an optional CAPTCHA feature that can be turned on in the config file. I'm rather fond of the ReCAPTCHA solution and was wondering if it would be possible to implement this without too much difficulty.

I'm familiar with PHP and am willing to make some code changes to make this work but would love a few tips to get me going quickly. In general terms, where and what files would I need to hack to get ReCAPTCHA working on comments in OJS?

If I get this up and running I'd be happy to share with the forum how I went about it but would love a head start with tips here.


Konrad (

Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC


Postby mcrider » Thu Feb 12, 2009 11:43 am

Hi Konrad,

I like reCaptcha too, especially given the initiatives of the Public Knowledge Project (reCaptcha helps digitize books). This would definitely involve some legwork, but it shouldn't be too difficult if you're familiar with PHP, as displaying a recaptcha and authorizing it is essentially the same process as we use for the regular captcha.

You could create a new class called reCaptcha, and model it off of the the Captcha class in classes/captcha/, include the PHP library provided by reCaptcha here, and then modify the CaptchaManager class to be able to use the reCaptcha class (ideally, it would check the file for a setting saying what type of Captcha to use, just as the call Config::getVar('captcha', 'captcha') checks to see if Captcha is enabled). Then, in the rest of the code where the CaptchaManager is called (and a captcha is displayed), you shouldn't have to make any modifications. Don't worry about the CaptchaDAO (which handles database calls), as reCaptcha does most of the work on their server, you won't have to worry about any database manipulation on the OJS end.

Hope that's enough to get you started,

Posts: 2
Joined: Thu Feb 12, 2009 5:47 am


Postby kmlawson » Sat Feb 14, 2009 2:06 am

Thanks for taking the time to give me these tips. I'm less familiar with the OOP side of PHP but this could be a fun project. I can't make any promises but for now I'll drop this into my "Coding ideas" folder and if I get it working will post something here. Perhaps by that time, some future version of OJS already supports ReCAPTCHA but we'll see.

Thanks again!

Wonderful work on OJS. It has something of a learning curve and is a bit too rich for a 2 person operation but now that I think I understand how things work we are up and running with our new OA gold journal at

Some suggestions while I'm here:

-put links to each of the supplemental materials (like a map etc.) below the abstract of a paper like the like to add a comment (rather than via a link to supplemental files in the frame of the reader tools). The way it is now makes it very easy to miss available resources.

-create some way for OJS to recognize a separate permanent linking structure. the current system has rather long links due to the file structure of OJS. In our case it is something like ( ... cle/view/1) for an article and even if I had installed OJS in the home directory the link would still be pretty long. I have set up an htaccess file which supports our own short url form for permanent linking to a pdf of the document. in the above case (

Posts: 1
Joined: Thu Feb 26, 2009 11:24 am


Postby omegadraconis » Thu Feb 26, 2009 11:27 am

I am also interested in doing the same thing. Thanks for the tips, if I do get anywhere with it I will post code here.

Posts: 140
Joined: Mon Mar 16, 2009 12:47 am
Location: Turkiye, İzmir


Postby solty » Tue Mar 23, 2010 4:48 am

I was create API key
I was add below to the
Whether or not to enable Captcha features
captcha = on

Whether or not to use Captcha on user registration / account creation
captcha_on_register = on
I was created this code from CAPTCHA after the registration:

$publickey = "6Lf0AQwAAAAAAB9oBp5xrRxsasxnxJPtyD7XsasPW4WDNZ"; // you got this from the signup page
echo recaptcha_get_html($publickey);

$privatekey = "6Lf0AQwAAAAAAF-LZsasaO9S7S_2sasykaGPjt8ijSrloCs";
$resp = recaptcha_check_answer ($privatekey,

if (!$resp->is_valid) {
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
and also, where is the location

I am new php code system.

Could you suggest contain sample code mentioned files (, recaptchalib.php, and also and files location?

Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am


Postby jmacgreg » Tue Mar 30, 2010 9:13 pm

Hi Solty,

I think this is a pretty old thread; but hopefully folks in it are still working on a reCaptcha module. We've added this as a feature request to Bugzilla here, but haven't quite gotten around to it yet, so you won't yet be able to use those reCaptcha keys with OJS. I'd suggest CCing yourself to that report for future updates, though!


Posts: 1
Joined: Tue Jul 27, 2010 10:51 pm


Postby mduckham » Wed Jul 28, 2010 5:13 pm

Does anyone have an update on the status of ReCAPTCHA module? Has anyone had success with one of these workarounds in this thread? I would also urgently like ReCAPTCHA support to enable low-vision accessibility at my OJS site, so would like to hear any experiences on the best way to do this (given limited php abilities).

Return to “OJS Technical Support”

Who is online

Users browsing this forum: No registered users and 1 guest