Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/branchoverdues.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

119 lines
5.8 KiB
Text

[% USE Branches %]
[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Overdues at [% LoginBranchname | html %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="circ_branchoverdues" 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; Overdues at [% LoginBranchname | html %]</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 %]
<div class="yui-g">
<h1>Circulation: Overdues at [% LoginBranchname | html %]</h1>
<form name="selectlocation" action="branchoverdues.pl" method="post">
<label for="location">Shelving location selected: </label><select id="location" name="location">
<option value="">All shelving locations</option>
[% FOREACH locationsloo IN locationsloop %]
[% IF ( locationsloo.selected ) %]<option value="[% locationsloo.authorised_value | html %]" selected="selected">[% locationsloo.lib | html %]</option>[% ELSE %]<option value="[% locationsloo.authorised_value | html %]">[% locationsloo.lib | html %]</option>[% END %]
[% END %]
</select>
<input type="submit" name="location" class="submit" value="OK" />
</form>
[% IF ( overduesloop ) %]
<table style="width:100%;">
<tr>
<th>Date due</th>
<th>Title</th>
<th>Patron</th>
<th>Location</th>
</tr>
[% FOREACH overduesloo IN overduesloop %]
<tr>
<td>
[% overduesloo.date_due | html %]
</td>
<td>
[% INCLUDE 'biblio-default-view.inc' biblionumber = overduesloo.biblionumber %][% overduesloo.title | html %] [% IF ( overduesloo.subtitle ) %][% overduesloo.subtitle | html %][% END %]</a> [% IF ( overduesloo.author ) %] by [% overduesloo.author | html %][% END %]
<br />Barcode : [% overduesloo.barcode | html %]
</td>
<td>
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% overduesloo.borrowernumber | html %]">[% overduesloo.borrowersurname | html %], [% overduesloo.borrowerfirstname | html %]</a>
<br />[% overduesloo.cardnumber | html %]
<br />[% overduesloo.borrowerphone | html %]<br />
[% IF ( overduesloo.borroweremail ) %]<a href="mailto:[% overduesloo.borroweremail | html %]?subject=Overdue: [% overduesloo.title | html %]">
[% overduesloo.borroweremail | html %]</a>[% END %]
</td>
<td>[% Branches.GetName( overduesloo.homebranch ) | html %] [% overduesloo.itemcallnumber | html %]
</td>
</tr>
[% END %]
</table>
[% ELSE %]
<div class="dialog message">There are no overdues for today[% IF ( location ) %] at the selected location[% END %].</div>
[% END %]
[% IF ( todayoverduesloop ) %]
<div id="branch_odues_today_odues">
<table style="width:100%;">
<caption>Today's notifications</caption>
<tr>
<th>Date due</th>
<th>Title</th>
<th>Borrower</th>
<th>Location</th>
<th>Cancel</th>
</tr>
[% FOREACH todayoverduesloo IN todayoverduesloop %]
<tr>
<td>
<p>
[% todayoverduesloo.date_due | html %]
</p>
</td>
<td>
<p>
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% todayoverduesloo.biblionumber | html %]">[% todayoverduesloo.title | html %]</a>
&nbsp; (<b>[% todayoverduesloo.description | html %]</b>)
<br />Barcode : [% todayoverduesloo.barcode | html %]
</p>
</td>
<td>
<p><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% todayoverduesloo.borrowernumber | html %]">[% todayoverduesloo.borrowersurname | html %] &nbsp; [% todayoverduesloo.borrowerfirstname | html %]</a>
<br />[% todayoverduesloo.cardnumber | html %]<br />
<br />[% todayoverduesloo.borrowerphone | html %]<br />
[% IF ( todayoverduesloo.borroweremail ) %]<a href="mailto:[% todayoverduesloo.borroweremail | html %]?subject=Overdue: [% todayoverduesloo.title | html %]">
[% todayoverduesloo.borroweremail | html %]</a>[% END %]
</p>
</td>
<td><p>[% Branches.GetName( todayoverduesloo.homebranch ) | html %] [% todayoverduesloo.itemcallnumber | html %]</p>
</td>
<td>
<a href="branchoverdues.pl?action=remove&amp;borrowernumber=[% todayoverduesloo.borrowernumber | html %]&amp;itemnumber=[% todayoverduesloo.itemnumber | html %]&amp;method=phone&amp;location=[% todayoverduesloo.location | html %]">Cancel notification</a>
</td>
</tr>
[% END %]
</table>
</div>
[% END %]
</div>
</div>
[% IF Koha.Preference('CircSidebar') %]
</div>
<div class="yui-b noprint">
[% INCLUDE 'circ-nav.inc' %]
</div>
[% END %]
</div>
[% INCLUDE 'intranet-bottom.inc' %]