Bugzilla – Attachment 28504 Details for
Bug 3144
anti-spam for opac-suggestions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 3144 - anti-spam for opac-suggestions
Bug-3144---anti-spam-for-opac-suggestions-to-test-.patch (text/plain), 3.09 KB, created by
Mason James
on 2014-05-28 00:33:52 UTC
(
hide
)
Description:
Bug 3144 - anti-spam for opac-suggestions
Filename:
MIME Type:
Creator:
Mason James
Created:
2014-05-28 00:33:52 UTC
Size:
3.09 KB
patch
obsolete
>From 5ca45d094656bad9375500cad13ce1861d25110c Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Wed, 28 May 2014 10:52:09 +1200 >Subject: [PATCH] Bug 3144 - anti-spam for opac-suggestions to test this > patch... >Content-Type: text/plain; charset="utf-8" > >1/ 1st, enable 'suggestion' and 'AnonSuggestions' sysprefs > >2/ disable javascript in your web-browser >3/ attempt to add a suggestion in OPAC, but leave the 'secret' field empty. > - adding the suggestion should succeed > > http://yourkoha.org/cgi-bin/koha/opac-suggestions.pl > >4/ attempt to add another suggestion, and populate 'secret' field > - adding the suggestion should fail > >5/ enable javascript in your web-browser > >6/ attempt to add a suggestion, > NOTE: the 'secret' field should now be hidden via javascript > - adding the suggestion should succeed >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt | 8 ++++++++ > opac/opac-suggestions.pl | 8 ++++++++ > 2 files changed, 16 insertions(+) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >index 5e52d84..b9cb3f6 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt >@@ -21,6 +21,10 @@ > }[% END %] > > $(function() { >+ >+ // BZ 3144 - dont display 'secret' recaptcha field >+ $("#secret").remove(); >+ > $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, { > "aaSorting": [[ 1, "asc" ]], > "aoColumnDefs": [ >@@ -124,6 +128,10 @@ > <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option> > [% END %]</select></li>[% END %] > <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40"></textarea></li> >+ >+ <!-- BZ 3144, add 'secret' recaptcha field --> >+ <li id="secret" ><label for="secret">secret:</label><input type="text" name="secret" size="50" maxlength="80" /></li> >+ > </ol></fieldset> > <fieldset class="action"><input type="hidden" name="suggestedby" value="[% suggestedbyme %]" /><input type="hidden" name="op" value="add_confirm" /><input type="submit" onclick="Check(this.form); return false;" value="Submit your suggestion" /> <a class="action" href="/cgi-bin/koha/opac-suggestions.pl">Cancel</a></fieldset> > </form> >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 72383eb..5c9e348 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -33,6 +33,14 @@ my $input = new CGI; > my $allsuggestions = $input->param('showall'); > my $op = $input->param('op'); > my $suggestion = $input->Vars; >+my $recaptcha = $input->param('secret'); >+ >+# BZ 3144 - if a spambot accidentally populates the 'secret' field in the submission form, then silently skip suggestion and return. >+if ($recaptcha ) { >+ print $input->redirect("/cgi-bin/koha/opac-suggestions.pl"); >+ exit; >+} >+ > delete $$suggestion{$_} foreach qw<op suggestedbyme>; > $op = 'else' unless $op; > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3144
:
1127
|
28504
|
28505
|
28506
|
28507
|
28508
|
28667
|
28701