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