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

138 lines
8 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Web installer &rsaquo;
[% IF all_done %]
Complete
[% ELSE %]
Create circulation rule
[% END %]
</title>
[% INCLUDE 'installer-doc-head-close.inc' %]
[% INCLUDE 'validator-strings.inc' %]
[% INCLUDE 'installer-strings.inc' %]
<script type="text/javascript" src="[% interface | html %]/[% theme | html %]/js/onboarding.js"></script>
</head>
<body id="installer" class="installer">
<div class="container-fluid">
<div class="row">
<div id="onboarding-step5" class="installer-main col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2">
<h1 id="logo"><a href="#">Koha</a></h1>
[% IF all_done %]
<h2>Web installer &rsaquo; Complete</h2>
[% INCLUDE 'onboarding_messages.inc' %]
<h3>Congratulations you have finished and are ready to use Koha</h3>
<a class="btn btn-success" href="/cgi-bin/koha/mainpage.pl">Start using Koha</a>
[% ELSE %]
<h2>Web installer &rsaquo; Create a new circulation rule </h2>
[% INCLUDE 'onboarding_messages.inc' %]
<form name="createcirculationrule" method="post" action="onboarding.pl">
<fieldset class="rows">
<input type="hidden" name="step" value="5"/>
<input type="hidden" name="op" value="add_validate_circ_rule" />
<ol>
<li>
<label for="branchname" class="required"> Library branch</label>
<select name="branch" id="branchname" required="required">
<option value=""> Choose</option>
<option value="*" selected="selected">All</option>
[% FOREACH library IN libraries %]
<option value="[% library.branchcode | html %]"> [% library.branchname | html %]</option>
[% END %]
</select>
<span class="required">Required</span>
</li>
<li>
<label for="categorycode" class="required">Patron category: </label>
<select name="categorycode" id="categorycode" required="required">
<option value=""> Choose</option>
<option value="*" selected="selected">All</option>
[% FOREACH category IN categories %]
<option value = "[% category.categorycode | html %]"> [% category.description | html %]</option>
[%END%]
</select>
<span class="required">Required</span>
</li>
<li>
<label for="itemtype"> Item type: </label>
<select id="itemtype" name="itemtype" required="required">
<option value=""> Choose </option>
<option value="*" selected="selected">All</option>
[% FOREACH item IN itemtypes %]
<option value = "[% item.itemtype | html %]"> [% item.itemtype | html %]
[%END%]
</select>
<span class="required"> Required</span>
</li>
<li>
<label for="maxissueqty" class="required">Current checkouts allowed: </label>
<input type="number" min="0" name="maxissueqty" id="maxissueqty" size="10" value="50" class="required" required="required" />
<span class="required">Required</span>
</li>
<li>
<label for="issuelength" class="required">Loan period: </label>
<input type="number" min="0" name="issuelength" id="issuelength" size="10" value="14" class="required" required="required" />
<span class="required">Required</span>
</li>
<li>
<label for="lengthunit">Units: </label>
<select name="lengthunit" id="lengthunit" required="required">
<option value=""> Choose </option>
[% SET units = 'days' %]
[% IF category %]
[% SET default_privacy = category.default_privacy %]
[% END %]
[% SWITCH units %]
[% CASE 'days' %]
<option value="days" selected="selected">Days</option>
<option value="hours">Hours</option>
[% CASE 'hours' %]
<option value="days">Days</option>
<option value="hours" selected="selected">Hours</option>
[% END %]
</select>
</li>
<li>
<label for="renewalsallowed" class="required">Renewals allowed: </label>
<input type="number" min="0" name="renewalsallowed" id="renewalsallowed" size="10" max="10" value="10" class="required" required="required" />
<span class="required">Required</span>
</li>
<li>
<label for="renewalperiod" class="required">Renewals period: </label>
<input type="number" min="0" name="renewalperiod" id="renewalperiod" size="10" value="14" class="required" required="required" />
<span class="required">Required</span>
</li>
<li>
<label for="onshelfholds">On shelf holds allowed: </label>
<select name="onshelfholds" id="onshelfholds" required="required">
<option value="">Choose</option>
<option value="1" selected="selected">Yes</option>
<option value="0">If any unavailable</option>
<option value="2">If all unavailable</option>
</select>
</li>
</ol>
<p>
To create circulation rule, go to:
<span class="breadcrumbs">Administration &rsaquo; Circulation and fine rules </span>
</p>
</fieldset>
<input type="submit" class="btn btn-primary" value="Submit" />
</form>
[% END %]
</div> <!-- / #onboarding-step5 -->
</div> <!-- / .row -->
[% INCLUDE 'intranet-bottom.inc' %]