Bugzilla – Attachment 144316 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), 6.75 KB, created by
Martin Renvoize (ashimema)
on 2022-11-29 12:29:10 UTC
(
hide
)
Description:
Bug 22990: Fix for shelves table
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-11-29 12:29:10 UTC
Size:
6.75 KB
patch
obsolete
>From 78a4bea3b3195e9380e4f67daa2fcbaadabb7448 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 > >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > .../prog/en/modules/virtualshelves/shelves.tt | 4 ++++ > .../en/modules/virtualshelves/tables/shelves_results.tt | 2 ++ > virtualshelves/shelves.pl | 8 +++++++- > 3 files changed, 13 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 4496f8f7c4..e67c2962b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -215,6 +215,7 @@ > <h1>Transfer ownership of public list [% shelf.shelfname | html %]</h1> > > <form action="/cgi-bin/koha/virtualshelves/shelves.pl" id="transferform" method="post"> >+ [% INCLUDE 'csrf-token.inc' %] > <fieldset> > <input type="hidden" name="op" value="transfer" /> > <input type="hidden" name="public" value="1" /> >@@ -247,6 +248,7 @@ > [% IF itemsloop %] > <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 %]" /> >@@ -395,6 +397,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' %] > <legend><h1>Create a new list</h1></legend> >@@ -554,6 +557,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 8e5a4c24d6..62216f4d6e 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 >@@ -39,6 +39,7 @@ > [%~ public = public | 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="public" value="' _ public _ '" />' ~%] >@@ -48,6 +49,7 @@ > [%~ END ~%] > [%~ IF 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 fa92cfcd6e..cdc9f133fc 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -29,7 +29,7 @@ use C4::Koha qw( > GetNormalizedUPC > ); > 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; >@@ -63,6 +63,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); > >@@ -78,6 +79,7 @@ if ( $op eq 'add_form' ) { > push @messages, { type => 'alert', code => 'does_not_exist' }; > } > } elsif ( $op eq 'add' ) { >+ output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); > my $allow_changes_from = $query->param('allow_changes_from'); > eval { > $shelf = Koha::Virtualshelf->new( >@@ -103,6 +105,7 @@ if ( $op eq 'add_form' ) { > $op = 'view'; > } > } elsif ( $op eq 'edit' ) { >+ output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); > $shelfnumber = $query->param('shelfnumber'); > $shelf = Koha::Virtualshelves->find($shelfnumber); > >@@ -133,6 +136,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) { >@@ -151,6 +155,7 @@ if ( $op eq 'add_form' ) { > } > $op = 'list'; > } elsif ( $op eq 'add_biblio' ) { >+ output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); > $shelfnumber = $query->param('shelfnumber'); > $shelf = Koha::Virtualshelves->find($shelfnumber); > if ($shelf) { >@@ -207,6 +212,7 @@ if ( $op eq 'add_form' ) { > } > $op = $referer; > } elsif ( $op eq 'remove_biblios' ) { >+ output_and_exit_if_error($query, $cookie, $template, { check => 'csrf_token' }); > $shelfnumber = $query->param('shelfnumber'); > $shelf = Koha::Virtualshelves->find($shelfnumber); > my @biblionumbers = $query->multi_param('biblionumber'); >-- >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