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