dcd1f5d48c
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>
95 lines
3.9 KiB
Text
95 lines
3.9 KiB
Text
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE Koha %]
|
|
[% USE Branches %]
|
|
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Patrons › Create manual invoice</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<body id="pat_maninvoice" class="pat">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'patron-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Manual invoice</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
[% INCLUDE 'members-toolbar.inc' %]
|
|
|
|
<!-- The manual invoice and credit buttons -->
|
|
<div class="statictabs">
|
|
<ul>
|
|
<li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Account</a></li>
|
|
<li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | html %]" >Pay fines</a></li>
|
|
<li class="active"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber | html %]" >Create manual invoice</a></li>
|
|
<li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber | html %]" >Create manual credit</a></li>
|
|
</ul>
|
|
<div class="tabs-container">
|
|
|
|
[% IF ( ERROR ) %]
|
|
[% IF ( ITEMNUMBER ) %]
|
|
ERROR an invalid itemnumber was entered, please hit back and try again
|
|
[% END %]
|
|
[% ELSE %]
|
|
<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 %]" />
|
|
<fieldset class="rows">
|
|
<legend>Manual invoice</legend>
|
|
<ol>
|
|
<li>
|
|
<label for="type">Type: </label>
|
|
<select name="type" id="invoice_type">
|
|
<option value="L">Lost item</option>
|
|
<option value="F">Fine</option>
|
|
<option value="A">Account management fee</option>
|
|
<option value="N">New card</option>
|
|
<option value="M">Sundry</option>
|
|
[% FOREACH invoice_types_loo IN invoice_types_loop %]
|
|
<option value="[% invoice_types_loo.authorised_value | html %]">[% invoice_types_loo.authorised_value | html %]</option>
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
|
|
<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
|
|
<li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
|
|
<li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
|
|
</ol></fieldset>
|
|
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a></fieldset>
|
|
</form>
|
|
|
|
[% END %]
|
|
</div></div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="yui-b">
|
|
[% INCLUDE 'circ-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
[% INCLUDE 'str/members-menu.inc' %]
|
|
[% Asset.js("js/members-menu.js") | $raw %]
|
|
<script type="text/javascript">
|
|
var type_fees = {'L':'','F':'','A':'','N':'','M':''};
|
|
[% FOREACH invoice_types_loo IN invoice_types_loop %]
|
|
type_fees['[% invoice_types_loo.authorised_value | html %]'] = "[% invoice_types_loo.lib | html %]";
|
|
[% END %]
|
|
$(document).ready(function(){
|
|
$('#maninvoice').preventDoubleFormSubmit();
|
|
$("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
|
|
$("#invoice_type").on("change",function(){
|
|
this.form.desc.value = this.options[this.selectedIndex].value;
|
|
this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
|
|
});
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|