Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt
Jonathan Druart dcd1f5d48c Bug 13618: Add html filters to all the variables
Here we go, next step then.
As we did not fix the performance issue when autofiltering
the variables (see bug 20975), the only solution we have is to add the
filters explicitely.

This patch has been autogenerated (using add_html_filters.pl, see next
pathces) and add the html filter to all the variables displayed in the
template.
Exceptions are made (using the new 'raw' TT filter) to the variable we
already listed in the previous versions of this patch.

To test:
- Use t/db_dependent/Koha/Patrons.t to populate your DB with autogenerated
data which contain <script> tags

- Remove them from borrower_debarments.comments (there are allowed here)
update  borrower_debarments set comment="html tags possible here";

- From the interface hit page and try to catch alert box.
If you find one it means you find a possible XSS.
To know where it comes from:
* note the exact URL where you found it
* note the alert box content
* Dump your DB and search for the string in the dump to identify its
location (for instance table.field)

Next:
* Ideally we would like to use the raw filter when it is not necessary
to HTML escape the variables (in big loop for instance)
* Provide a QA script to catch missing filters (we want html, uri, url
or raw, certainly others that I am forgetting now)
* Replace the html filters with uri when needed (!)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-08-17 15:55:05 +00:00

187 lines
10 KiB
Text

[% USE Koha %]
[% USE KohaDates %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Renew [% title | html %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="circ_renew" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Renew</div>
[% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc" class="yui-t7">[% END %]
<div id="bd">
<div id="yui-main">
[% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
[% IF error %]
<div class="dialog alert">
<h3>Cannot renew:</h3>
[% IF error == "no_item" %]
<p>No item matches this barcode</p>
[% ELSIF error == "no_checkout" %]
<p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblio.biblionumber | html %]">[% item.biblio.title | html %] [% item.biblioitem.subtitle | html %]</a> ( <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.itemnumber | html %]&amp;biblionumber=[% item.biblio.biblionumber | html %]&amp;bi=[% item.biblioitemnumber.biblioitemnumber | html %]#item[% item.itemnumber | html %]">[% item.barcode | html %]</a> ) is not checked out to a patron.</p>
[% ELSIF error == "too_many" %]
<p>[% item.biblio.title | html %] [% item.biblioitem.subtitle | html %] ( [% item.barcode | html %] ) has been renewed the maximum number of times by [% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | html %]"> [% borrower.cardnumber | html %] </a> )</p>
[% IF Koha.Preference('AllowRenewalLimitOverride') %]
<form method="post" action="/cgi-bin/koha/circ/renew.pl">
<input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
<input type="hidden" name="override_limit" value="1" />
<button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
</form>
[% END %]
[% ELSIF error == "too_soon" %]
<p>[% item.biblio.title | html %] [% item.biblioitem.subtitle | html %] ( [% item.barcode | html %] ) cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
[% IF Koha.Preference('AllowRenewalLimitOverride') %]
<form method="post" action="/cgi-bin/koha/circ/renew.pl">
<input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
<input type="hidden" name="override_limit" value="1" />
<button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
</form>
[% END %]
[% ELSIF error == "auto_too_soon" %]
<p>[% item.biblio.title | html %] [% item.biblioitem.subtitle | html %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
[% IF Koha.Preference('AllowRenewalLimitOverride') %]
<form method="post" action="/cgi-bin/koha/circ/renew.pl">
<input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
<input type="hidden" name="override_limit" value="1" />
<button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
</form>
[% END %]
[% ELSIF error == "auto_too_late" %]
<p>[% item.biblio.title | html %] [% item.biblioitem.subtitle | html %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed anymore since [% latestautorenewdate | $KohaDates %]. </p>
[% IF Koha.Preference('AllowRenewalLimitOverride') %]
<form method="post" action="/cgi-bin/koha/circ/renew.pl">
<input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
<input type="hidden" name="override_limit" value="1" />
<input type="submit" class="approve" value="Override and renew" />
</form>
[% END %]
[% ELSIF error == "auto_account_expired" %]
<p>[% item.biblio.title | html %] [% item.biblioitem.subtitle | html %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal and cannot be renewed because the patron's account is expired</p>
[% IF Koha.Preference('AllowRenewalLimitOverride') %]
<form method="post" action="/cgi-bin/koha/circ/renew.pl">
<input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
<input type="hidden" name="override_limit" value="1" />
<input type="submit" class="approve" value="Override and renew" />
</form>
[% END %]
[% ELSIF error == "auto_renew" or error == "auto_too_much_oweing" %]
<p>[% item.biblio.title | html %] [% item.biblioitem.subtitle | html %] ( [% item.barcode | html %] ) has been scheduled for automatic renewal. </p>
[% IF Koha.Preference('AllowRenewalLimitOverride') %]
<form method="post" action="/cgi-bin/koha/circ/renew.pl">
<input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
<input type="hidden" name="override_limit" value="1" />
<button type="submit" class="approve"><i class="fa fa-check"></i> Override limit and renew</button>
</form>
[% END %]
[% ELSIF error == "on_reserve" %]
<p>This item is on hold for another patron.</p>
<form method="post" action="/cgi-bin/koha/circ/renew.pl">
<input type="hidden" name="barcode" value="[% item.barcode | html %]"/>
<input type="hidden" name="override_limit" value="1" />
<input type="hidden" name="override_holds" value="1" />
<button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button>
</form>
[% ELSIF error == "patron_restricted" %]
<p>[% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | html %]"> [% borrower.cardnumber | html %] </a> ) is currently restricted.</p>
[% ELSE %]
[% error | html %]
[% END %]
<form method="get" action="/cgi-bin/koha/circ/renew.pl">
<button type="submit" class="deny"><i class="fa fa-times"></i> Continue without renewing</button>
</form>
</div>
[% END %]
[% IF date_due %]
<div class="dialog message">
<h3>Item renewed:</h3>
<p>
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblio.biblionumber | html %]">[% item.biblio.title | html %] [% item.biblioitem.subtitle | html %]</a>
( <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.itemnumber | html %]&amp;biblionumber=[% item.biblio.biblionumber | html %]&amp;bi=[% item.biblioitemnumber.biblioitemnumber | html %]#item[% item.itemnumber | html %]">[% item.barcode | html %]</a> )
renewed for
[% borrower.firstname | html %] [% borrower.surname | html %] ( <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber | html %]"> [% borrower.cardnumber | html %] </a> )
now due on [% date_due | $KohaDates %]
</p>
</div>
[% END %]
<div class="yui-g">
[% UNLESS error %]
<form method="post" action="/cgi-bin/koha/circ/renew.pl" autocomplete="off" >
<div class="yui-u first">
<fieldset>
<legend>Renew</legend>
<label for="barcode">Enter item barcode: </label>
<input name="barcode" id="barcode" size="14" class="focus"/>
<input type="submit" class="submit" value="Submit" />
</fieldset>
</div>
</form>
[% END %]
</div>
</div>
[% IF Koha.Preference('CircSidebar') %]
</div>
<div class="yui-b noprint">
[% INCLUDE 'circ-nav.inc' %]
</div>
[% END %]
<div>
[% MACRO jsinclude BLOCK %]
[% IF error %]
<script type="text/javascript">
$( document ).ready(function() {
removeFocus();
});
</script>
[% END %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]