Bug 22576: OPAC password text refresh
[koha-equinox.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-passwd.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Change your password</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %][% END %]
8 </head>
9 [% INCLUDE 'bodytag.inc' bodyid='opac-passwd' %]
10 [% INCLUDE 'masthead.inc' %]
11
12 <div class="main">
13     <ul class="breadcrumb">
14         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
15         <li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
16         <li><a href="#">Change your password</a></li>
17     </ul>
18
19     <div class="container-fluid">
20         <div class="row-fluid">
21             <div class="span2">
22                 <div id="navigation">
23                     [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
24                 </div>
25             </div>
26             <div class="span10">
27                 <div id="userpasswd">
28                     <h3>Change your password </h3>
29
30                     [% IF ( Error_messages ) %]
31                         <div class="alert">
32                             <h3>There was a problem with your submission</h3>
33                             <p>
34                                 [% IF ( passwords_mismatch ) %]
35                                 Passwords do not match.  Please re-type your new password.
36                                 [% END %]
37                                 [% IF password_too_short %]
38                                     Password must be at least [% minPasswordLength | html %] characters long.
39                                 [% END %]
40                                 [% IF password_too_weak %]
41                                     Password must contain at least one digit, one lowercase and one uppercase.
42                                 [% END %]
43                                 [% IF password_has_whitespaces %]
44                                     Password must not contain leading or trailing whitespaces.
45                                 [% END %]
46
47                                 [% IF ( WrongPass ) %]
48                                 Your current password was entered incorrectly.  If this problem persists, please ask a librarian to reset your password for you.
49                                 [% END %]
50                             </p>
51                         </div>
52                     [% END # /IF Error_messages %]
53
54                     [% IF logged_in_user.category.effective_change_password %]
55                         [% IF ( Ask_data ) %]
56
57
58                             <form action="/cgi-bin/koha/opac-passwd.pl" name="mainform" id="mainform" method="post" autocomplete="off">
59                                 <fieldset>
60                                     [% IF ( Koha.Preference('RequireStrongPassword') ) %]
61                                         <div class="alert alert-info">Your password must contain at least [% Koha.Preference('minPasswordLength') | html %] characters, including UPPERCASE, lowercase and numbers.</div>
62                                     [% ELSE %]
63                                         <div class="alert alert-info">Your password must be at least [% Koha.Preference('minPasswordLength') | html %] characters long.</div>
64                                     [% END %]
65                                     <label for="Oldkey">Current password:</label> <input type="password" id="Oldkey" size="25"  name="Oldkey" />
66                                     <label for="Newkey">New password:</label> <input type="password" id="Newkey"  size="25"  name="Newkey" />
67                                     <label for="Confirm">Re-type new password:</label> <input type="password"  id="Confirm" size="25" name="Confirm" />
68                                 </fieldset>
69                                 <fieldset class="action"><input type="submit" value="Change password" class="btn" /> <a href="/cgi-bin/koha/opac-user.pl" class="cancel">Cancel</a></fieldset>
70                             </form>
71                         [% END # /IF Ask_data %]
72                     [% ELSE %]
73                         <div class="alert">You can't change your password.</div>
74                     [% END # /IF logged_in_user.category.effective_change_password %]
75
76                     [% IF ( password_updated ) %]
77                         <div class="alert alert-success">
78                             <h1>Password updated</h1>
79                             Your password has been changed
80                         </div>
81                         <form action="/cgi-bin/koha/opac-user.pl" method="post" autocomplete="off">
82                             <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
83                             <p><input type="submit" class="btn" value="Return to my account" /></p>
84                         </form>
85                     [% END # /IF password_updated %]
86                 </div> <!-- / #userpasswd -->
87             </div> <!-- / .span10 -->
88         </div> <!-- / .row-fluid -->
89     </div> <!-- / .container-fluid -->
90 </div> <!-- / .main -->
91
92
93
94 [% INCLUDE 'opac-bottom.inc' %]
95 [% BLOCK jsinclude %]
96     [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
97     [% PROCESS 'password_check.inc' %]
98     [% PROCESS 'add_password_check' new_password => 'Newkey' %]
99     <script>
100         $(document).ready(function() {
101             $("#mainform").validate({
102                 rules: {
103                     Newkey: {
104                         required: true,
105                         password_strong: true,
106                         password_no_spaces: true
107                     },
108                     Confirm: {
109                         required: true,
110                         password_match: true
111                     }
112                 }
113             });
114         });
115     </script>
116 [% END %]