We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 6261 - Add optional captcha for article submission
Add optional captcha for article submission
Status: NEW
Product: OJS
Classification: Unclassified
Component: Framework
All All
: P3 normal
Assigned To: PKP Support
: 6266 (view as bug list)
Depends on:
Blocks: 6267
  Show dependency treegraph
Reported: 2010-11-29 15:30 PST by Michael Felczak
Modified: 2012-09-21 14:14 PDT (History)
3 users (show)

See Also:
Version Reported In: 2.3.3
Also Affects:

patch against OJS-stable-2_3 (6.60 KB, patch)
2011-06-09 13:36 PDT, Mike Kamermans
Details | Diff
patch against OCS master (4.48 KB, patch)
2011-06-13 14:08 PDT, Mike Kamermans
Details | Diff
patch against OJS-master (11.70 KB, patch)
2011-06-14 12:03 PDT, Mike Kamermans
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Felczak 2010-11-29 15:30:50 PST
To block spam submissions via automated submission scripts.

Can be ported to OCS as well.
Comment 1 Alec Smecher 2011-06-07 16:24:29 PDT
*** Bug 6266 has been marked as a duplicate of this bug. ***
Comment 2 Mike Kamermans 2011-06-09 11:33:13 PDT
I'd like to tackle this in two stages; The primary goal will be to get the code as it is used for registration and comments to also work for submissions, but the controls for enabling Captcha are site-wide at the moment, which is hardly ideal. It would be nicer if these were per-journal settings, handled during site setup (as settings in 4.1, for instance), so if this sounds like a good idea I can have a look at effecting that, too.
Comment 3 Alec Smecher 2011-06-09 11:53:46 PDT
Adding journal-specific configuration options for captcha is out of scope for OJS/OCS 2.3.x since it'll require new locale keys; I'd suggest sticking with the current approach for now, and filing a new entry to move the options into setup. Registration is site-wide, so can't be moved to per-journal settings; commenting and article submission, however, could be made journal-specific.
Comment 4 Mike Kamermans 2011-06-09 12:31:02 PDT
Fair enough, I'll just do the adding of captcha to submissions, then. This needs a small documentation change, btw, http://pkp.sfu.ca/ojs/docs/userguide/2.3.3/systemAdministrationCaptcha.html currently says servers need IMLIB installed, this should be GD (for php4) or GD2 (for php5)
Comment 5 James MacGregor 2011-06-09 12:59:22 PDT
(In reply to comment #4)
> Fair enough, I'll just do the adding of captcha to submissions, then. This
> needs a small documentation change, btw,
> http://pkp.sfu.ca/ojs/docs/userguide/2.3.3/systemAdministrationCaptcha.html
> currently says servers need IMLIB installed, this should be GD (for php4) or
> GD2 (for php5)

Thanks, Mike -- documentation has been updated.
Comment 6 Mike Kamermans 2011-06-09 13:36:01 PDT
Created attachment 3551 [details]
patch against OJS-stable-2_3

This patch adds spam protection in the form of captcha validation to the article submission process in the same way user registration and article comments use captchas, in submission step one, and used only when the config.inc.php "captcha_on_submission" is set to "on" (config.TEMPLATE.inc.php has been updated accordingly).

Step one seemed the most sensible choice, because any later step will show an active but incomplete article submission for the editors and section editors, so putting it in step one  maintains workflow integrity.

I could not find a suitable key for this element, so for the moment this patch has a new key, <message key="author.submit.spamProtection">Spam protection</message> - if there is a better, already existing alternative I will be happy to modify the patch to use that one instead ("validation" was not role-indicative enough).
Comment 7 Alec Smecher 2011-06-10 10:46:20 PDT
Since we're talking about adding a new locale key, this is in 2.4 release territory, not 2.3.x -- therefore it's best to develop against OJS master, rather than the ojs-stable-2_3 branch. That branch has ReCAPTCHA support for existing CAPTCHA tests, but this patch doesn't. Could you try to adapt it for that, against master?
Comment 8 Mike Kamermans 2011-06-10 16:40:25 PDT
Hmm, I can't get OCS master installed. With a checkout of OCS master and lib-pkp master, running through the install script (with an empty new database) ends in "DB Error: Field 'locale' doesn't have a default value", and a broken installation.
Comment 9 Alec Smecher 2011-06-10 16:49:02 PDT
Mike, do you mind tracking that down? The master branch won't be terribly stable at the moment, but nothing there should be very complicated to fix; probably a matter of typos and cruft. The "debug" option in config.inc.php might help.
Comment 10 Mike Kamermans 2011-06-13 14:08:11 PDT
Created attachment 3556 [details]
patch against OCS master

This patch fixes a problem where the installer makes a plugin_setting table with seven columns (original six + locale), but still tries to insert data based on the old six column layout. This patches files in OCS master as well as the version of lib/pkp used in OCS master.
Comment 11 Mike Kamermans 2011-06-13 14:22:48 PDT
comments 8, 9 and 10 actually belong with bug #6573, as that deals with OCS master, rather than OJS master.
Comment 12 Mike Kamermans 2011-06-13 17:29:54 PDT
OJS master has the same problem as OCS master, where the official lib-pkp code and the corresponding install and settingupdating scripts have not been made aware of the fact that that several tables have been extended with locale columns. I've just tried a fresh checkout using the instructions from http://pkp.sfu.ca/wiki/index.php/HOW-TO_check_out_PKP_applications_from_git (substituting ojs for omp) and hit a wall on installing again.
Comment 13 Mike Kamermans 2011-06-14 12:03:20 PDT
Created attachment 3560 [details]
patch against OJS-master

This adds the captcha and recaptcha functionality to the author submission process in the same vein as the OJS-stable-2_3 patch. Captcha functionality is added to the end of step 1, as any later step counts as an incomplete submission for the system. This also introduces a new key to the authors.xml locale file.
Comment 14 Alec Smecher 2011-06-15 09:30:50 PDT
Mike, I'm assuming that the patch against OCS master is obsolete?
Comment 15 Mike Kamermans 2011-06-15 10:44:47 PDT
Indeed, this was due to bug #6683