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