Bug 27742: Page titles have unique info first
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-password-recovery.tt
1 [% USE Koha %]
2 [% USE Categories %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Forgotten password recovery &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
7 [% BLOCK jsinclude %]
8 [% IF (new_password) %]
9     [% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
10     [% PROCESS 'password_check.inc' new_password => 'newPassword', minPasswordLength => minPasswordLength, RequireStrongPassword => RequireStrongPassword %]
11 [% END %]
12     <script>
13     $(function() {
14             $("#CheckAll").click(function(){
15                     $("[name=deleteRequest]").attr('checked', true);
16                     return false;
17                 });
18
19             $("#CheckNone").click(function(){
20                     $("[name=deleteRequest]").attr('checked', false);
21                     return false;
22                 });
23
24             $("select#type").change(function() {
25                 $("fieldset#serial, fieldset#book, fieldset#chapter").hide()
26                 $("fieldset#" + $(this).val() ).show();
27             });
28         [% IF (new_password) %]
29             $("#mainform").validate({
30                 rules: {
31                     newPassword: {
32                         required: true,
33                         password_strong: true,
34                         password_no_spaces: true
35                     },
36                     repeatPassword: {
37                         required: true,
38                         password_match: true
39                     }
40                 }
41             });
42         [% END %]
43     });
44     </script>
45 [% END %]
46 </head>
47 [% INCLUDE 'bodytag.inc' bodyid='opac-password-recovery' %]
48 [% INCLUDE 'masthead.inc' %]
49
50 <div class="main">
51     <nav aria-label="breadcrumb">
52         <ul class="breadcrumb">
53             <li class="breadcrumb-item">
54                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
55             </li>
56             <li class="breadcrumb-item" aria-current="page">
57                 <a href="#">Forgotten password recovery</a>
58             </li>
59         </ul>
60     </nav>
61
62     <div class="container-fluid">
63         <div class="row">
64             <div class="col-lg-2">
65                 [% IF ( OpacPublic ) %]
66                     <div id="navigation">
67                         [% INCLUDE 'navigation.inc' IsPatronPage=0 %]
68                     </div>
69                 [% END %]
70             </div>
71             <div class="col-6 order-first order-md-first order-lg-2 maincontent">
72                 <h3>Forgotten password recovery</h3>
73                 [% IF (hasError) %]
74                     <div class="alert alert-warning">
75                         <h3>Error</h3>
76                         <p>
77                         [% IF (sendmailError) %]
78                             An error has occurred while sending you the password recovery link.
79                             <br/>Please try again later.
80                         [% ELSIF (errNoBorrowerFound) %]
81                             No account was found with the provided information.
82                         [% ELSIF errResetForbidden %]
83                             <span id="password-reset-forbidden">Sorry, your password cannot be changed online.</span>
84                         [% ELSIF (errMultipleAccountsForEmail) %]
85                             Account identification with this email address only is ambiguous.
86                             <br />Please use the field 'Login' as well.
87                         [% ELSIF (errNoBorrowerEmail) %]
88                             This account has no email address we can send the email to.
89                         [% ELSIF (errAlreadyStartRecovery) %]
90                             The process of password recovery has already been started for this account
91                             [% IF username %]
92                                 ("<strong>[% username | html %]</strong>")
93                             [% ELSIF email %]
94                                 ("<strong>[% email | html %]</strong>")
95                             [% END %]
96                             <br/>You should have received an email with a link to reset your password.
97                             <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>
98                         [% ELSIF (errPassNotMatch) %]
99                             The passwords do not match.
100                         [% ELSIF password_too_short %]
101                             <li>Password must be at least [% minPasswordLength | html %] characters long.</li>
102                         [% ELSIF password_too_weak %]
103                             <li>Password must contain at least one digit, one lowercase and one uppercase.</li>
104                         [% ELSIF password_has_whitespaces %]
105                             <li>Password must not contain leading or trailing whitespaces.</li>
106                         [% ELSIF (errLinkNotValid) %]
107                             The link you clicked is either invalid, or expired.
108                             <br/>Be sure you used the link from the email, or contact library staff for assistance.
109                         [% END %]
110                         </p>
111                         <p>Please contact the library if you need further assistance.</p>
112                     </div> <!-- /div.alert.alert-warning -->
113                 [% END # /IF hasError %]
114
115                 <div id="password-recovery">
116                     [% IF (! Categories.can_any_reset_password ) %]
117                         <div class="alert alert-info">You can't reset your password.</div>
118                     [% ELSIF (password_recovery) %]
119                         <form action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
120                             <input type="hidden" name="koha_login_context" value="opac" />
121                             <p>To reset your password, enter your login or your email address.</p>
122                             <fieldset class="brief">
123                                 <div class="form-group">
124                                     <label for="username">Login:</label>
125                                     <input class="form-control" type="text" id="username" size="40" name="username" value="[% username | html %]" />
126                                 </div>
127
128                                 <div class="form-group">
129                                     <label for="email">Email:</label>
130                                     <input class="form-control" type="text" id="email" size="40" name="email" value="[% email | html %]" />
131                                 </div>
132
133                                 <fieldset class="action">
134                                     <input type="submit" value="Submit" class="btn btn-primary" name="sendEmail" />
135                                 </fieldset>
136                             </fieldset>
137                         </form>
138                     [% ELSIF (new_password) %]
139                         [% UNLESS ( errLinkNotValid ) %]
140                             <form id="mainform" name="mainform" action="/cgi-bin/koha/opac-password-recovery.pl" method="post" autocomplete="off">
141                                 <input type="hidden" name="koha_login_context" value="opac" />
142                                 <fieldset class="brief">
143                                     [% IF ( RequireStrongPassword ) %]
144                                         <div class="alert alert-info">Your password must contain at least [% minPasswordLength | html %] characters, including UPPERCASE, lowercase and numbers.</div>
145                                     [% ELSE %]
146                                         <div class="alert alert-info">Your password must be at least [% minPasswordLength | html %] characters long.</div>
147                                     [% END %]
148                                     <div class="form-group">
149                                         <label for="newPassword">New password:</label>
150                                         <input class="form-control" type="password" id="newPassword" size="40" name="newPassword" />
151                                     </div>
152
153                                     <div class="form-group">
154                                         <label for="repeatPassword">Confirm new password:</label>
155                                         <input class="form-control" type="password" id="repeatPassword" size="40" name="repeatPassword" />
156                                     </div>
157
158                                     <fieldset class="action">
159                                         <input type="hidden" name="username" value="[% username | html %]" />
160                                         <input type="hidden" name="uniqueKey" value="[% uniqueKey | html %]" />
161                                         <input type="submit" value="Submit" class="btn btn-primary" name="passwordReset" />
162                                     </fieldset>
163                                 </fieldset>
164                             </form>
165                         [% END # /UNLESS errLinkNotValid %]
166                     [% ELSIF (mail_sent) %]
167                         <div class="alert alert-info">
168                             <p>
169                                 You will receive an email shortly.
170                                 <br/>Please click the link in this email to finish the process of resetting your password.
171                                 <br/>This link is valid for 2 days starting now.
172                             </p>
173                             <a href="/cgi-bin/koha/opac-main.pl">Return to the main page</a>
174                         </div>
175                     [% ELSIF (password_reset_done) %]
176                         <div class="alert alert-success">
177                             <p>The password has been changed for user "[% username | html %]".</p>
178                             <a href="/cgi-bin/koha/opac-user.pl">Log in to your account.</a>
179                         </div>
180                     [% END # /IF (! Categories.can_any_reset_password ) %]
181                 </div><!-- / #password-recovery -->
182             </div><!-- / .span10 -->
183         </div><!-- / .row-fluid -->
184     </div><!-- / .container-fluid -->
185 </div><!-- / .main -->
186 [% INCLUDE 'opac-bottom.inc' %]