Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/accountline-details.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

139 lines
6.6 KiB
Text

[%- USE Price -%]
[%- USE KohaDates -%]
[%- USE AuthorisedValues -%]
[%- USE Branches -%]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="pat_discharges" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Account for [% INCLUDE 'patron-title.inc' %]</a> &rsaquo; Details for account line [% accountline.id | html %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF accountline %]
[% IF type == 'credit' %]
<h2>Details for payment</h2>
[% ELSIF type == 'debit' %]
<h2>Details for fee</h2>
[% END %]
<table id="table_account_fines">
<thead>
<tr>
<th class="title-string">Date</th>
<th>Description of charges</th>
<th>Note</th>
<th>Amount</th>
<th>Outstanding</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span title="[% accountline.date | html %]">[% accountline.date |$KohaDates %]</span>
</td>
<td>
[%- INCLUDE 'accounttype.inc' account => accountline -%]
[%- IF accountline.payment_type -%]
, [% AuthorisedValues.GetByCode('PAYMENT_TYPE', accountline.payment_type) | html %]
[%- END =%]
[%- IF accountline.description -%]
, [% accountline.description | html %]
[%- END -%]
&nbsp;
[% IF ( accountline.itemnumber ) %]
[% SET biblio = accountline.item.biblio %]
<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | html %]&amp;itemnumber=[% accountline.itemnumber | html %]">[% biblio.title | html %]</a>
[% END %]
</td>
<td>
[% accountline.note | html_line_break %]
</td>
<td>
[% accountline.amount | $Price | html %]
</td>
<td>
[% accountline.amountoutstanding | $Price | html %]
</td>
</tr>
</tbody>
</table>
[% IF type == 'credit' %]
<h3>Fees paid</h3>
[% ELSIF type == 'debit' %]
<h3>Payments</h3>
[% END %]
[% IF account_offsets %]
<table class="accountline-offsets-table" id="accountline-debits-table">
<thead>
<tr>
<th>Date created</th>
<th>Date updated</th>
<th>Amount</th>
<th>Amount outstanding</th>
<th>Type</th>
<th>Note</th>
<th>Transacting librarian</th>
<th>Date/Time of change</th>
<th>Amount of change</th>
<th>Type of change</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
[% FOREACH ao IN account_offsets %]
[% IF type == 'credit' %]
[% SET offset_accountline = ao.debit %]
[% ELSIF type == 'debit' %]
[% SET offset_accountline = ao.credit %]
[% END %]
[% IF offset_accountline %]
<tr>
<td>[% offset_accountline.date | $KohaDates %]</td>
<td>[% offset_accountline.timestamp | $KohaDates with_hours => 1 | html %]</td>
<td>[% offset_accountline.amount | $Price | html %]</td>
<td>[% offset_accountline.amountoutstanding | $Price | html %]</td>
<td>[% INCLUDE 'accounttype.inc' account => offset_accountline %]</td>
<td>[% offset_accountline.note | html %]</td>
<td>[% IF offset_accountline.manager_id %]<a href="moremember.pl?borrowernumber=[% offset_accountline.manager_id | html %]">[% offset_accountline.manager_id | html %]</a>[% END %]</td>
<td>[% ao.created_on | $KohaDates with_hours => 1 | html %]</td>
<td>[% ao.amount | $Price | html %]</td>
<td>[% INCLUDE 'account_offset_type.inc' account_offset => ao %]</td>
<td><a href="accountline-details.pl?accountlines_id=[% offset_accountline.id | html %]" class="btn btn-default btn-xs"><i class="fa fa-list"></i> Details</a></td>
</tr>
[% END %]
[% END %]
</tbody>
</table>
[% ELSE %]
No details available for this payment.
[% END %]
[% ELSE %]
<div class="dialog message">
<p>Account line not found.</p>
</div>
[% END %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'circ-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]