Bug 34478: Replace csrf_token input with include file
perl -p -i -n -e 's#<input type="hidden" name="csrf_token" value="\[% csrf_token \| html %]" />#[% INCLUDE '\''csrf-token.inc'\'' %]#g' **/*.tt **/*.inc This should have actually been done at the same time as "Bug 30524: (QA follow-up) Only generate CSRF token if it will be used" Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
8e3901342a
commit
4481fb3377
|
|
@ -262,7 +262,7 @@
|
|||
</div>
|
||||
<input type="hidden" name="uploadfilename" value="patron-photo.jpg" />
|
||||
<textarea id="uploadfiletext" name="uploadfiletext" style="display:none;"></textarea>
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="filetype" value="image" />
|
||||
<input type="hidden" name="cardnumber" value="[% patron.cardnumber | html %]" />
|
||||
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
</ol>
|
||||
</fieldset>
|
||||
<input type="hidden" name="bib_list" value="[% bib_list | html %]" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
|
||||
<nav class="navbar navbar-default navbar-fixed-bottom">
|
||||
<div class="container-fluid">
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
|
||||
<form id="add-api-key" action="/cgi-bin/koha/members/apikeys.pl" method="post" style="display:none">
|
||||
<input type="hidden" name="patron_id" value="[% patron.id | html %]" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="generate" />
|
||||
<fieldset class="brief">
|
||||
<legend>Generate new client id/secret pair</legend>
|
||||
|
|
@ -102,14 +102,14 @@
|
|||
<form action="/cgi-bin/koha/members/apikeys.pl" method="post">
|
||||
<input type="hidden" name="patron_id" value="[% patron.id | html %]" />
|
||||
<input type="hidden" name="key" value="[% key.id | html %]" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="delete" />
|
||||
<button class="btn btn-default btn-xs delete" type="submit"><i class="fa fa-trash-can"></i> Delete</button>
|
||||
</form>
|
||||
<form action="/cgi-bin/koha/members/apikeys.pl" method="post">
|
||||
<input type="hidden" name="patron_id" value="[% patron.id | html %]" />
|
||||
<input type="hidden" name="key" value="[% key.id | html %]" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
[% IF key.active %]
|
||||
<input type="hidden" name="op" value="revoke" />
|
||||
<button class="btn btn-default btn-xs" type="submit"><i class="fa fa-times"></i> Revoke</button>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
<h1>Are you sure you want to delete the patron [% patron.firstname | html %] [% patron.surname | html %]?</h1>
|
||||
<p>This cannot be undone.</p>
|
||||
<form action="/cgi-bin/koha/members/deletemem.pl">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="member" value="[% patron.borrowernumber | html %]"/>
|
||||
<input type="hidden" name="op" value="delete_confirmed" />
|
||||
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@
|
|||
<div role="tabpanel" class="tab-pane active">
|
||||
<form action="/cgi-bin/koha/members/mancredit.pl" method="post" id="mancredit">
|
||||
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
|
||||
<fieldset class="rows">
|
||||
<legend>Manual credit</legend>
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
[% END %]
|
||||
<form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice">
|
||||
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<fieldset class="rows">
|
||||
<legend>Manual invoice</legend>
|
||||
<ol>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
[% INCLUDE 'members-toolbar.inc' %]
|
||||
|
||||
<form id="flag_form" method="post" action="/cgi-bin/koha/members/member-flags.pl">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="member" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
|
||||
<input type="hidden" name="newflags" value="1" />
|
||||
<h1>Set permissions for [% INCLUDE 'patron-title.inc' no_html = 1 %]</h1>
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@
|
|||
</ol>
|
||||
</fieldset>
|
||||
<fieldset class="action">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="submit" class="btn btn-primary" value="Save" />
|
||||
<a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
|
||||
</fieldset>
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ legend:hover {
|
|||
<input type="hidden" name="check_member" value="[% check_member | html %]" />
|
||||
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html UNLESS opduplicate %]" />
|
||||
<input type="hidden" name="nodouble" value="[% nodouble | html UNLESS opduplicate %]" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
[% IF ( step ) %]
|
||||
<input type="hidden" name="step" value="[% step | html %]" />
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@
|
|||
</ul>
|
||||
|
||||
<form name="payindivfine" id="payindivfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
|
||||
<input type="hidden" name="pay_individual" id="pay_individual" value="[% pay_individual | html %]" />
|
||||
<input type="hidden" name="itemnumber" id="itemnumber" value="[% itemnumber | html %]" />
|
||||
|
|
@ -232,7 +232,7 @@
|
|||
</ul>
|
||||
|
||||
<form name="woindivfine" id="woindivfine" action="/cgi-bin/koha/members/pay.pl" method="post" >
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<fieldset class="rows">
|
||||
<legend>Write off an individual charge</legend>
|
||||
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
|
||||
|
|
@ -299,7 +299,7 @@
|
|||
[% END %]
|
||||
|
||||
<form name="payfine" id="payfine" method="post" action="/cgi-bin/koha/members/paycollect.pl">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
|
||||
<input type="hidden" name="selected_accts" id="selected_accts" value="[% selected_accts | html %]" />
|
||||
<input type="hidden" name="total" id="total" value="[% total | html %]" />
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
<div class="two-factor-status">Status: Enabled</div>
|
||||
|
||||
<form id="two-factor-auth" action="/cgi-bin/koha/members/two_factor_auth.pl" method="post">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="disable-2FA" />
|
||||
<input type="submit" value="Disable two-factor authentication" />
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@
|
|||
</fieldset>
|
||||
|
||||
<fieldset class="action">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="submit" class="btn btn-primary" value="Import" />
|
||||
</fieldset>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
</ol>
|
||||
</fieldset>
|
||||
<fieldset class="action">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="Upload" />
|
||||
<input type="submit" class="btn btn-primary" value="Upload" />
|
||||
<a href="/cgi-bin/koha/tools/tools-home.pl" class="cancel">Cancel</a>
|
||||
|
|
|
|||
|
|
@ -1081,7 +1081,7 @@
|
|||
[% IF OPACPatronDetails %]
|
||||
<fieldset class="action">
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="submit" class="btn btn-primary" value="Submit update request" />
|
||||
</fieldset>
|
||||
[% END %]
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
<div class="alert alert-success"><p><strong>Settings updated</strong></p></div>
|
||||
[% END %]
|
||||
<form action="/cgi-bin/koha/opac-messaging.pl" method="post" name="opacmessaging">
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="modify" value="yes" />
|
||||
|
||||
[% IF Koha.Preference( 'EnhancedMessagingPreferencesOPAC' ) %]
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
<label for="comment">Comment:</label>
|
||||
<textarea id="comment" name="comment" rows="4" cols="40" class="form-control"></textarea>
|
||||
<input type="hidden" name="bib_list" value="[% bib_list | html %]" />
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
</fieldset>
|
||||
[% IF Koha.Preference('OPACHoldRequests') || Koha.Preference('OpacRenewalAllowed') %]<p id="donotrequestbymail">Please do not use this mail to request or renew books.</p>[% END %]
|
||||
<fieldset class="action">
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@
|
|||
<input type="radio" id="no-autorenew_checkouts" name="borrower_autorenew_checkouts" value="0" checked="checked" />
|
||||
</label>
|
||||
[% END %]
|
||||
<input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="update_arc" value="1" />
|
||||
<input type="submit" value="Update auto-renewal preference" />
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Reference in New Issue