View | Details | Raw Unified | Return to bug 3144
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt (+8 lines)
Lines 21-26 Link Here
21
}[% END %]
21
}[% END %]
22
22
23
       $(function() {
23
       $(function() {
24
25
            // BZ 3144 - dont display 'secret' recaptcha field
26
            $("#secret").remove();
27
24
            $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
28
            $("#suggestt").dataTable($.extend(true, {}, dataTablesDefaults, {
25
                "aaSorting": [[ 1, "asc" ]],
29
                "aaSorting": [[ 1, "asc" ]],
26
                "aoColumnDefs": [
30
                "aoColumnDefs": [
Lines 124-129 Link Here
124
           <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>
128
           <option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>
125
    [% END %]</select></li>[% END %]
129
    [% END %]</select></li>[% END %]
126
    <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40"></textarea></li>
130
    <li><label for="note">Notes:</label><textarea name="note" id="note" rows="5" cols="40"></textarea></li>
131
132
    <!--  BZ 3144, add 'secret' recaptcha field -->
133
    <li id="secret" ><label for="secret">secret:</label><input type="text" name="secret" size="50" maxlength="80" /></li>
134
127
    </ol></fieldset>
135
    </ol></fieldset>
128
        <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>
136
        <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>
129
    </form>
137
    </form>
(-)a/opac/opac-suggestions.pl (-1 / +8 lines)
Lines 33-38 my $input = new CGI; Link Here
33
my $allsuggestions  = $input->param('showall');
33
my $allsuggestions  = $input->param('showall');
34
my $op              = $input->param('op');
34
my $op              = $input->param('op');
35
my $suggestion      = $input->Vars;
35
my $suggestion      = $input->Vars;
36
my $recaptcha       = $input->param('secret');
37
38
# BZ 3144 - if a spambot accidentally populates the 'secret' field in the submission form, then silently skip suggestion and return.
39
if ($recaptcha ) {
40
    print $input->redirect("/cgi-bin/koha/opac-suggestions.pl");
41
    exit;
42
}
43
36
delete $$suggestion{$_} foreach qw<op suggestedbyme>;
44
delete $$suggestion{$_} foreach qw<op suggestedbyme>;
37
$op = 'else' unless $op;
45
$op = 'else' unless $op;
38
46
39
- 

Return to bug 3144