Bugzilla – Attachment 124933 Details for
Bug 22990
Add CSRF protection to boraccount, pay, suggestions and virtualshelves on staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22990: Fix for shelves table
Bug-22990-Fix-for-shelves-table.patch (text/plain), 4.79 KB, created by
Martin Renvoize (ashimema)
on 2021-09-16 14:20:46 UTC
(
hide
)
Description:
Bug 22990: Fix for shelves table
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-09-16 14:20:46 UTC
Size:
4.79 KB
patch
obsolete
>From 1208a4b8fa7e72ccb463f169c01efafe8c711ad7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 16 Sep 2021 15:13:23 +0100 >Subject: [PATCH] Bug 22990: Fix for shelves table > >--- > .../intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 3 +++ > .../prog/en/modules/virtualshelves/tables/shelves_results.tt | 2 ++ > virtualshelves/shelves.pl | 4 +++- > 3 files changed, 8 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index b2f12a4b4e..d8d38f61c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -188,6 +188,7 @@ > <h3>Contents of <em>[% shelf.shelfname | html %]</em></h3> > <div class="pages">[% pagination_bar | $raw %]</div> > <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="listform" method="post"> >+ [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="remove_biblios" /> > <input type="hidden" name="referer" value="view" /> > <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" /> >@@ -316,6 +317,7 @@ > [% IF op == 'add_form' OR op == 'edit_form' %] > > <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" class="validated"> >+ [% INCLUDE 'csrf-token.inc' %] > <fieldset class="rows"> > > [% IF op == 'add_form' %] >@@ -450,6 +452,7 @@ > <div class="modal" id="addToList" tabindex="-1" role="dialog" aria-labelledby="addToListLabel"> > <div class="modal-dialog" role="document"> > <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post"> >+ [% INCLUDE 'csrf-token.inc' %] > <div class="modal-content"> > <div class="modal-header"> > <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >index 8a1dbdc18b..7e1e615a7a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/tables/shelves_results.tt >@@ -38,6 +38,7 @@ > [%~ type = type | html ~%] > [%~ IF can_manage_shelf ~%] > [%~ action_block = '<form action="shelves.pl" method="get">' ~%] >+ [%~ action_block = action_block _ '[% INCLUDE 'csrf-token.inc' %]' ~%] > [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%] > [%~ action_block = action_block _ '<input type="hidden" name="op" value="edit_form" />' ~%] > [%~ action_block = action_block _ '<input type="hidden" name="category" value="' _ type _ '" />' ~%] >@@ -47,6 +48,7 @@ > [%~ END ~%] > [%~ IF can_manage_shelf OR can_delete_shelf ~%] > [%~ action_block = action_block _ ' <form action="shelves.pl" method="post">' ~%] >+ [%~ action_block = action_block _ '[% INCLUDE 'csrf-token.inc' %]' ~%] > [%~ action_block = action_block _ '<input type="hidden" name="shelves" value="1" />' ~%] > [%~ action_block = action_block _ '<input type="hidden" name="op" value="delete" />' ~%] > [%~ action_block = action_block _ '<input type="hidden" name="shelfnumber" value="' _ shelfnumber _ '" />' ~%] >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index 25f2127b1c..1c3006b89a 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -29,7 +29,7 @@ use C4::Koha qw( > ); > use C4::Items qw( GetItemsLocationInfo ); > use C4::Members; >-use C4::Output qw( pagination_bar output_html_with_http_headers ); >+use C4::Output qw( pagination_bar output_html_with_http_headers output_and_exit_if_error ); > use C4::XSLT qw( XSLTParse4Display ); > > use Koha::Biblios; >@@ -61,6 +61,7 @@ if ( $op eq 'add_form' ) { > # Only pass default > $shelf = { allow_change_from_owner => 1 }; > } elsif ( $op eq 'edit_form' ) { >+ output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); > $shelfnumber = $query->param('shelfnumber'); > $shelf = Koha::Virtualshelves->find($shelfnumber); > >@@ -129,6 +130,7 @@ if ( $op eq 'add_form' ) { > push @messages, { type => 'alert', code => 'does_not_exist' }; > } > } elsif ( $op eq 'delete' ) { >+ output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); > $shelfnumber = $query->param('shelfnumber'); > $shelf = Koha::Virtualshelves->find($shelfnumber); > if ($shelf) { >-- >2.20.1
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 22990
:
90102
|
90192
|
90194
|
90202
|
90204
|
90209
|
90238
|
90239
|
90240
|
95381
|
95382
|
95383
|
95384
|
95385
|
95391
|
95392
|
95393
|
95394
|
95395
|
95396
|
97814
|
122010
|
122011
|
122012
|
122013
|
122014
|
122015
|
122016
|
122023
|
122024
|
122025
|
122026
|
122027
|
122028
|
122029
|
122030
|
122031
|
122046
|
124924
|
124925
|
124926
|
124927
|
124928
|
124929
|
124930
|
124931
|
124932
|
124933
|
124934
|
126091
|
126092
|
126093
|
126094
|
126095
|
126096
|
126097
|
126098
|
126099
|
126100
|
126101
|
133238
|
133239
|
133240
|
133241
|
133242
|
133243
|
133244
|
133245
|
133246
|
133247
|
133248
|
133254
|
133255
|
133256
|
133257
|
133258
|
133422
|
133423
|
133424
|
133425
|
133426
|
133427
|
134848
|
134849
|
134850
|
134851
|
134852
|
134853
|
134854
|
141294
|
141295
|
141296
|
144315
|
144316
|
144317
|
144318
|
144319
|
144320
|
144321
|
144322
|
152626
|
152627
|
152628
|
153394
|
153751
|
153753
|
154044