PKP Bugzilla – Bug 6261
Add optional captcha for article submission
Last modified: 2012-09-21 14:14:28 PDT
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.
To block spam submissions via automated submission scripts.
Can be ported to OCS as well.
*** Bug 6266 has been marked as a duplicate of this bug. ***
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.
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.
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)
(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,
> currently says servers need IMLIB installed, this should be GD (for php4) or
> GD2 (for php5)
Thanks, Mike -- documentation has been updated.
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).
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?
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.
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.
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.
comments 8, 9 and 10 actually belong with bug #6573, as that deals with OCS master, rather than OJS master.
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.
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.
Mike, I'm assuming that the patch against OCS master is obsolete?
Indeed, this was due to bug #6683