Bug 22560: Forgotten password "token expired" page still shows boxes to reset password
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-password-recovery.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Forgotten password recovery</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% BLOCK cssinclude %][% END %]
6 [% BLOCK jsinclude %]
7 <script>
8    $(function() {
9         $("#CheckAll").click(function(){
10                 $("[name=deleteRequest]").attr('checked', true);
11                 return false;
12             });
13
14         $("#CheckNone").click(function(){
15                 $("[name=deleteRequest]").attr('checked', false);
16                 return false;
17             });
18
19         $("select#type").change(function() {
20             $("fieldset#serial, fieldset#book, fieldset#chapter").hide()
21             $("fieldset#" + $(this).val() ).show();
22         });
23    });
24 </script>
25 [% END %]
26 </head>
27 [% INCLUDE 'bodytag.inc' bodyid='opac-password-recovery' %]
28 [% INCLUDE 'masthead.inc' %]
29
30 <div class="main">
31     <ul class="breadcrumb">
32         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
33         <li><a href="#">Forgotten password recovery</a></li>
34     </ul>
35
36     <div class="container-fluid">
37         <div class="row-fluid">
38             <div class="span2">
39                 [% IF ( OpacPublic ) %]
40
41                 <div id="navigation">
42                     [% INCLUDE 'navigation.inc' IsPatronPage=0 %]
43                 </div>
44                 [% END %]
45             </div>
46             <div class="span10">
47                     <h3>Forgotten password recovery</h3>
48             [% IF (hasError) %]
49                 <div class="alert alert-warning">
50                     <h3>Error</h3>
51                     <p>
52                     [% IF (sendmailError) %]
53                         An error has occurred while sending you the password recovery link.
54                         <br/>Please try again later.
55                     [% ELSIF (errNoBorrowerFound) %]
56                         No account was found with the provided information.
57                     [% ELSIF (errMultipleAccountsForEmail) %]
58                         Account identification with this email address only is ambiguous.
59                         <br />Please use the field 'Login' as well.
60                     [% ELSIF (errAlreadyStartRecovery) %]
61                         The process of password recovery has already been started for this account
62                         [% IF username %]
63                             ("<strong>[% username | html %]</strong>")
64                         [% ELSIF email %]
65                             ("<strong>[% email | html %]</strong>")
66                         [% END %]
67                         <br/>You should have received an email with a link to reset your password.
68                         <br/>If you did not receive this email, you can request a new one: <a href="/cgi-bin/koha/opac-password-recovery.pl?resendEmail=true&email=[% email | uri %]&username=[% username | uri %]">Get new password recovery link</a>
69                     [% ELSIF (errPassNotMatch) %]
70                         The passwords do not match.
71                     [% ELSIF password_too_short %]
72                         <li>Password must be at least [% minPasswordLength | html %] characters long.</li>
73                     [% ELSIF password_too_weak %]
74                         <li>Password must contain at least one digit, one lowercase and one uppercase.</li>
75                     [% ELSIF password_has_whitespaces %]
76                         <li>Password must not contain leading or trailing whitespaces.</li>
77                     [% ELSIF (errLinkNotValid) %]
78                         The link you clicked is either invalid, or expired.
79                         <br/>Be sure you used the link from the email, or contact library staff for assistance.
80                     [% END %]
81                     </p>
82                     <p>Please contact the library if you need further assistance.</p>
83                 </div>
84             [% END %]
85                 <div id="password-recovery">
86 [% IF (!Koha.Preference('OpacResetPassword')) %]
87                     <div class="alert alert-info">You can't reset your password.</div>
88 [% ELSIF (password_recovery) %]
89                     <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
90                         <input type="hidden" name="koha_login_context" value="opac" />
91                         <fieldset>
92                             <p>To reset your password, enter your login or your email address.
93                             <label for="username">Login:</label>
94                             <input type="text" id="username" size="40" name="username" value="[% username | html %]" />
95                             <label for="email">Email:</label>
96                             <input type="text" id="email" size="40" name="email" value="[% email | html %]" />
97                             <fieldset class="action">
98                                 <input type="submit" value="Submit" class="btn" name="sendEmail" />
99                             </fieldset>
100                          </fieldset>
101                     </form>
102 [% ELSIF (new_password) %]
103     [% UNLESS ( errLinkNotValid ) %]
104                     <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
105                         <input type="hidden" name="koha_login_context" value="opac" />
106                         <fieldset>
107                             [% IF ( Koha.Preference('RequireStrongPassword') ) %]
108                                 <div class="alert alert-info">Your password must contain at least [% Koha.Preference('minPasswordLength') | html %] characters, including UPPERCASE, lowercase and numbers.</div>
109                             [% ELSE %]
110                                 <div class="alert alert-info">Your password must be at least [% Koha.Preference('minPasswordLength') | html %] characters long.</div>
111                             [% END %]
112                             <label for="password">New password:</label>
113                             <input type="password" id="password" size="40" name="password" />
114                             <label for="repeatPassword">Confirm new password:</label>
115                             <input type="password" id="repeatPassword" size="40" name="repeatPassword" />
116                             <fieldset class="action">
117                                 <input type="hidden" name="username" value="[% username | html %]" />
118                                 <input type="hidden" name="uniqueKey" value="[% uniqueKey | html %]" />
119                                 <input type="submit" value="Submit" class="btn" name="passwordReset" />
120                             </fieldset>
121                          </fieldset>
122                     </form>
123     [% END %]
124 [% ELSIF (mail_sent) %]
125                     <div class="alert alert-info">
126                         <p>
127                             You will receive an email shortly.
128                             <br/>Please click the link in this email to finish the process of resetting your password.
129                             <br/>This link is valid for 2 days starting now.
130                         </p>
131                         <a href="/cgi-bin/koha/opac-main.pl">Return to the main page</a>
132                     </div>
133 [% ELSIF (password_reset_done) %]
134                     <div class="alert alert-success">
135                         <p>The password has been changed for user "[% username | html %]".</p>
136                         <a href="/cgi-bin/koha/opac-user.pl">Click here to login.</a>
137                     </div>
138 [% END %]
139                 </div><!-- / #password-recovery -->
140             </div><!-- / .span10 -->
141         </div><!-- / .row-fluid -->
142     </div><!-- / .container-fluid -->
143 </div><!-- / .main -->
144 [% INCLUDE 'opac-bottom.inc' %]