|
Lines 82-88
Link Here
|
| 82 |
[% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %] |
82 |
[% IF field == "B_email" %]<li>Alternate address information: <a href="#borrower_B_email">email address</a></li>[% END %] |
| 83 |
[% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %] |
83 |
[% IF field == "password_match" %]<li>Passwords do not match! <a href="#password">password</a></li>[% END %] |
| 84 |
[% IF field == "password_too_short" %] |
84 |
[% IF field == "password_too_short" %] |
| 85 |
<li>Password must be at least [% minPasswordLength | html %] characters long.</li> |
85 |
<li>Password must be at least [% patron.category.effective_min_password_length | html %] characters long.</li> |
| 86 |
[% END %] |
86 |
[% END %] |
| 87 |
[% IF field == "password_too_weak" %] |
87 |
[% IF field == "password_too_weak" %] |
| 88 |
<li>Password must contain at least one digit, one lowercase and one uppercase.</li> |
88 |
<li>Password must contain at least one digit, one lowercase and one uppercase.</li> |
|
Lines 252-260
Link Here
|
| 252 |
<select id="borrower_categorycode" name="borrower_categorycode"> |
252 |
<select id="borrower_categorycode" name="borrower_categorycode"> |
| 253 |
[% FOREACH c IN Categories.all() %] |
253 |
[% FOREACH c IN Categories.all() %] |
| 254 |
[% IF c.categorycode == Koha.Preference('PatronSelfRegistrationDefaultCategory') %] |
254 |
[% IF c.categorycode == Koha.Preference('PatronSelfRegistrationDefaultCategory') %] |
| 255 |
<option value="[% c.categorycode | html %]" selected="selected">[% c.description | html %]</option> |
255 |
<option value="[% c.categorycode | html %]" data-pwd-length="[% c.effective_min_password_length | html %]" data-pwd-strong="[% c.effective_require_strong_password | html %]" selected="selected">[% c.description | html %]</option> |
| 256 |
[% ELSE %] |
256 |
[% ELSE %] |
| 257 |
<option value="[% c.categorycode | html %]">[% c.description | html %]</option> |
257 |
<option value="[% c.categorycode | html %]" data-pwd-length="[% c.effective_min_password_length | html %]" data-pwd-strong="[% c.effective_require_strong_password | html %]">[% c.description | html %]</option> |
| 258 |
[% END %] |
258 |
[% END %] |
| 259 |
[% END %] |
259 |
[% END %] |
| 260 |
</select> |
260 |
</select> |
|
Lines 858-867
Link Here
|
| 858 |
<fieldset class="rows" id="memberentry_password"> |
858 |
<fieldset class="rows" id="memberentry_password"> |
| 859 |
<legend id="contact_legend">Password</legend> |
859 |
<legend id="contact_legend">Password</legend> |
| 860 |
<div class="alert alert-info"> |
860 |
<div class="alert alert-info"> |
| 861 |
[% IF ( Koha.Preference('RequireStrongPassword') ) %] |
861 |
[% IF patron %] |
| 862 |
<p>Your password must contain at least [% Koha.Preference('minPasswordLength') | html %] characters, including UPPERCASE, lowercase and numbers.</p> |
862 |
[% IF ( patron.category.effective_require_strong_password ) %] |
|
|
863 |
<p>Your password must contain at least [% patron.category.effective_min_password_length | html %] characters, including UPPERCASE, lowercase and numbers.</p> |
| 864 |
[% ELSE %] |
| 865 |
<p>Your password must be at least [% patron.category.effective_min_password_length | html %] characters long.</p> |
| 866 |
[% END %] |
| 863 |
[% ELSE %] |
867 |
[% ELSE %] |
| 864 |
<p>Your password must be at least [% Koha.Preference('minPasswordLength') | html %] characters long.</p> |
868 |
<p id="password_alert"></p> |
| 865 |
[% END %] |
869 |
[% END %] |
| 866 |
[% UNLESS mandatory.defined('password') %] |
870 |
[% UNLESS mandatory.defined('password') %] |
| 867 |
<p>If you do not enter a password a system generated password will be created.</p> |
871 |
<p>If you do not enter a password a system generated password will be created.</p> |
|
Lines 1008-1015
Link Here
|
| 1008 |
[% INCLUDE 'opac-bottom.inc' %] |
1012 |
[% INCLUDE 'opac-bottom.inc' %] |
| 1009 |
[% BLOCK jsinclude %] |
1013 |
[% BLOCK jsinclude %] |
| 1010 |
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %] |
1014 |
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %] |
| 1011 |
[% PROCESS 'password_check.inc' %] |
1015 |
|
| 1012 |
[% PROCESS 'add_password_check' new_password => 'borrower_password' %] |
|
|
| 1013 |
<script> |
1016 |
<script> |
| 1014 |
//<![CDATA[ |
1017 |
//<![CDATA[ |
| 1015 |
$(document).ready(function() { |
1018 |
$(document).ready(function() { |
|
Lines 1170-1176
Link Here
|
| 1170 |
}); |
1173 |
}); |
| 1171 |
}); |
1174 |
}); |
| 1172 |
[% END %] |
1175 |
[% END %] |
|
|
1176 |
|
| 1177 |
[% UNLESS patron %] |
| 1178 |
var PWD_STRONG_MSG = _("Password must contain at least %s characters, including UPPERCASE, lowercase and numbers"); |
| 1179 |
var PWD_WEAK_MSG = _("Password must contain at least %s characters"); |
| 1180 |
$(document).ready(function() { |
| 1181 |
var setPwdMessage = function() { |
| 1182 |
var require_strong = $('select#borrower_categorycode option:selected').data('pwdStrong'); |
| 1183 |
var min_lenght = $('select#borrower_categorycode option:selected').data('pwdLength'); |
| 1184 |
$('#password_alert').html((require_strong?PWD_STRONG_MSG:PWD_WEAK_MSG).format(min_lenght)); |
| 1185 |
}; |
| 1186 |
setPwdMessage(); |
| 1187 |
$('select#borrower_categorycode').change(setPwdMessage); |
| 1188 |
}); |
| 1189 |
[% END %] |
| 1173 |
//]]> |
1190 |
//]]> |
| 1174 |
</script> |
1191 |
</script> |
| 1175 |
[% INCLUDE 'calendar.inc' %] |
1192 |
[% PROCESS 'password_check.inc' new_password => 'borrower_password', category_selector => '#borrower_categorycode', RequireStrongPassword => patron.category.effective_require_strong_password, minPasswordLength => patron.category.effective_min_password_length %] |
|
|
1193 |
|
| 1176 |
[% END %] |
1194 |
[% END %] |