Lines 1-3
Link Here
|
|
|
1 |
[% USE Koha %] |
1 |
[% USE Branches %] |
2 |
[% USE Branches %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
3 |
[% INCLUDE 'doc-head-open.inc' %] |
3 |
<title>Koha › Patrons › [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %]</title> |
4 |
<title>Koha › Patrons › [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %]</title> |
Lines 5-32
Link Here
|
5 |
<script type="text/JavaScript"> |
6 |
<script type="text/JavaScript"> |
6 |
//<![CDATA[ |
7 |
//<![CDATA[ |
7 |
|
8 |
|
8 |
function check_password( password ) { |
|
|
9 |
if ( password.match(/^\s/) || password.match(/\s$/)) { |
10 |
return false; |
11 |
} |
12 |
return true; |
13 |
} |
14 |
|
15 |
$(document).ready(function() { |
9 |
$(document).ready(function() { |
16 |
var MSG_PASSWORD_CONTAINS_TRAILING_SPACES = _("Password contains leading and/or trailing spaces."); |
|
|
17 |
$("#changepasswordf").submit(function(){ |
18 |
if($("input[name='newpassword']").val() != $("input[name='newpassword2']").val()){ |
19 |
alert(_("Passwords do not match")); |
20 |
return false; |
21 |
} else { |
22 |
if ( ! check_password( $("input[name='newpassword']").val() ) ) { |
23 |
alert(MSG_PASSWORD_CONTAINS_TRAILING_SPACES); |
24 |
return false; |
25 |
} else { |
26 |
return true; |
27 |
} |
28 |
} |
29 |
}); |
30 |
$("body").on('click', "#fillrandom",function(e) { |
10 |
$("body").on('click', "#fillrandom",function(e) { |
31 |
e.preventDefault(); |
11 |
e.preventDefault(); |
32 |
$.get("/cgi-bin/koha/members/member-password.pl?member=[% userid %]", function(response) { |
12 |
$.get("/cgi-bin/koha/members/member-password.pl?member=[% userid %]", function(response) { |
Lines 46-51
Link Here
|
46 |
$("input[name^=newpassword]").show(); |
26 |
$("input[name^=newpassword]").show(); |
47 |
$("label[for=newpassword2]").show(); |
27 |
$("label[for=newpassword2]").show(); |
48 |
$(".loading").hide(); |
28 |
$(".loading").hide(); |
|
|
29 |
$("label.error").hide(); |
30 |
}); |
31 |
[% IF NOMATCH %] |
32 |
$("#newpassword").addClass('focus'); |
33 |
[% END %] |
34 |
|
35 |
$("#changepasswordf").validate({ |
36 |
rules: { |
37 |
newpassword: { |
38 |
required: true, |
39 |
password_strong: true, |
40 |
password_no_spaces: true |
41 |
}, |
42 |
newpassword2: { |
43 |
required: true, |
44 |
password_match: true |
45 |
} |
46 |
} |
49 |
}); |
47 |
}); |
50 |
}); |
48 |
}); |
51 |
//]]> |
49 |
//]]> |
Lines 98-118
Link Here
|
98 |
<ol> |
96 |
<ol> |
99 |
<li><label for="newuserid">New username:</label> |
97 |
<li><label for="newuserid">New username:</label> |
100 |
<input type="hidden" name="member" value="[% borrowernumber %]" /><input type="text" id="newuserid" name="newuserid" size="20" value="[% userid %]" /></li> |
98 |
<input type="hidden" name="member" value="[% borrowernumber %]" /><input type="text" id="newuserid" name="newuserid" size="20" value="[% userid %]" /></li> |
101 |
<li><label for="newpassword">New password:</label> |
99 |
[% SET password_pattern = ".{" _ minPasswordLength _ ",}" %] |
102 |
<div class="hint">Koha cannot display existing passwords. Leave the field blank to leave password unchanged.</div> |
100 |
[% IF Koha.Preference('RequireStrongPassword') %] |
103 |
[% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %] |
101 |
[% SET password_pattern = '(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{' _ minPasswordLength _ ',}' %] |
104 |
[% IF ( NOMATCH ) %] |
102 |
[% END %] |
105 |
<input name="newpassword" id="newpassword" type="password" size="20" class="focus" /> |
103 |
<li> |
106 |
<input name="newpassword" id="newpassword_random" readonly="readonly" disabled="disabled" type="hidden" /> |
104 |
<label for="newpassword">New password:</label> |
107 |
[% ELSE %] |
105 |
<div class="hint">Koha cannot display existing passwords. Leave the field blank to leave password unchanged.</div> |
108 |
<input name="newpassword" id="newpassword" type="password" size="20" /> |
106 |
<input name="newpassword" id="newpassword" type="password" size="20" /> |
109 |
<input name="newpassword" readonly="readonly" disabled="disabled" type="hidden" /> |
107 |
</li> |
110 |
[% END %] |
108 |
<li> |
111 |
</li> |
109 |
<label for="newpassword2">Confirm new password:</label> |
112 |
<li><label for="newpassword2">Confirm new password:</label> |
110 |
<input name="newpassword2" id="newpassword2" type="password" size="20" /> |
113 |
<input name="newpassword2" id="newpassword2" type="password" size="20" /> |
111 |
</li> |
114 |
<input name="newpassword2" id="newpassword2_random" readonly="readonly" disabled="disabled" type="hidden" /> |
|
|
115 |
</li> |
116 |
</ol> |
112 |
</ol> |
117 |
</fieldset> |
113 |
</fieldset> |
118 |
<fieldset class="action"> |
114 |
<fieldset class="action"> |
Lines 131-133
Link Here
|
131 |
</div> |
127 |
</div> |
132 |
</div> |
128 |
</div> |
133 |
[% INCLUDE 'intranet-bottom.inc' %] |
129 |
[% INCLUDE 'intranet-bottom.inc' %] |
|
|
130 |
[% PROCESS 'password_check.inc' %] |
131 |
[% PROCESS 'add_password_check' new_password => 'newpassword' %] |