Bug 35261: Update links for self registration avoiding "here"
[koha.git] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-auth.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Categories %]
4 [% USE AdditionalContents %]
5 [% USE AuthClient %]
6 [% PROCESS 'html_helpers.inc' %]
7 [% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>
10 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
11     Log in to your account
12 [% ELSE %]
13     Catalog login disabled
14 [% END %] &rsaquo;
15  [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog
16 </title>
17 [% INCLUDE 'doc-head-close.inc' %]
18 [% BLOCK cssinclude %][% END %]
19 </head>
20 [% INCLUDE 'bodytag.inc' bodyid='opac-login-page' bodyclass='scrollto' %]
21 [% INCLUDE 'masthead.inc' %]
22
23 <div class="main">
24     [% WRAPPER breadcrumbs %]
25         [% WRAPPER breadcrumb_item bc_active= 1 %]
26             <span>Log in</span>
27         [% END %]
28     [% END #/ WRAPPER breadcrumbs %]
29
30     <div class="container-fluid">
31         <div class="row justify-content-center">
32             <div class="col-md-10 col-lg-6">
33                 <div id="opac-auth" class="maincontent">
34                     <!--CONTENT-->
35                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
36                         [% IF ( nopermission ) %]
37                             <!-- This is what is displayed if user doesn't have permission -->
38                             <div class="alert alert-warning">
39                                 <h1>Access denied</h1>
40                                 <p>Sorry, the system doesn't think you have permission to access this page. </p>
41                                 [% IF SCO_login %]
42                                     <p><a href="/cgi-bin/koha/sco/sco-main.pl?logout.x=1">Log out and try again with a different user.</a></p>
43                                 [% ELSIF SCI_login %]
44                                     <p><a href="/cgi-bin/koha/sci/sci-main.pl?logout.x=1">Log out and try again with a different user.</a></p>
45                                 [% END %]
46                             </div>
47                         [% END %]
48
49                         [% IF ( loginprompt ) %]
50                             <!-- login prompt time-->
51                             <h1>Log in to your account</h1>
52
53                             [% IF ( timed_out ) %]
54                                 <!-- This is what is displayed if login has timed out -->
55                                 <div class="alert alert-info">
56                                     <p>Sorry, your session has timed out. Please log in again.</p>
57                                 </div>
58                             [% END %]
59
60                             [% IF ( different_ip ) %]
61                                 <!-- This is what is displayed if user doesn't have permission -->
62                                 <div class="alert alert-info">
63                                     <p>You are logging from a different IP address. Please log in again.</p>
64                                 </div>
65                             [% END %]
66
67
68                             [% IF invalid_username_or_password || too_many_login_attempts %]
69                                 <!-- This is what is displayed if user doesn't have permission or account is locked. (Do not expose more information than needed.) -->
70                                 <div class="alert alert-info">
71                                     <p>You entered an incorrect username or password. Please try again! But note that passwords are case sensitive[% IF Koha.Preference('FailedLoginAttempts') %] and that your account will be locked out after a fixed number of failed login attempts[% END %]. Please contact a library staff member if you continue to have problems.</p>
72                                 </div>
73                             [% END %]
74
75                             [% IF auth_error %]
76                                 <div class="alert alert-info">
77                                     <p>There was an error authenticating to external identity provider</p>
78                                     <p>[% auth_error | html %]</p>
79                                 </div>
80                             [% END %]
81
82                             [% IF ( shibbolethAuthentication ) %]
83                                 [% IF ( invalidShibLogin ) %]
84                                     <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
85                                     <div class="alert alert-info">
86                                         <p class="shib_invalid">Sorry, your Shibboleth identity does not match a valid library identity.</p>
87                                         [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
88                                             [% IF ( casAuthentication ) %]
89                                                 [% IF ( invalidCasLogin ) %]
90                                                     <!-- This is what is displayed if cas login has failed -->
91                                                     <p>Sorry, the CAS login also failed. If you have a local login you may use that below.</p>
92                                                 [% ELSE %]
93                                                     <p>If you have a CAS account, you may use that below.</p>
94                                                 [% END %]
95                                             [% ELSE %]
96                                                 <p>If you have a local account, you may use that below.</p>
97                                             [% END %]
98                                         [% END %]
99                                     </div>
100                                 [% ELSE %]
101                                     <h2 class="shib_title">Shibboleth login</h2>
102                                     <p><a class="shib_url" href="[% shibbolethLoginUrl | $raw %]">Log in using a Shibboleth account.</a></p>
103                                 [% END # /IF invalidShibLogin %]
104                                 [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
105                                     [% IF ( casAuthentication ) %]
106                                         <h2>CAS login</h2>
107                                         <p>If you do not have a Shibboleth account, but you do have a CAS account, you can use CAS.</p>
108                                     [% ELSE %]
109                                         <h2 class="shib_local_title">Local login</h2>
110                                         <p class="shib_local_text">If you do not have a Shibboleth account, but you do have a local login, then you may login below.</p>
111                                     [% END %]
112                                 [% END %]
113                             [% END # /IF shibbolethAuthentication %]
114
115                         [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
116                             [% IF ( casAuthentication ) %]
117                                 [% IF ( shibbolethAuthentication ) %]
118                                     [% IF ( casServerUrl ) %]
119                                         <p><a href="[% casServerUrl | $raw %]">Log in.</a><p>
120                                     [% END %]
121
122                                     [% IF ( casServersLoop ) %]
123                                         <p>Please choose against which one you would like to authenticate: </p>
124                                         <ul>
125                                             [% FOREACH casServer IN casServersLoop %]
126                                                 <li><a href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
127                                             [% END %]
128                                         </ul>
129                                     [% END %]
130                                 [% ELSE %]
131                                     <h2>CAS login</h2>
132
133                                     [% IF ( invalidCasLogin ) %]
134                                         <!-- This is what is displayed if cas login has failed -->
135                                         <p>Sorry, the CAS login failed.</p>
136                                     [% END %]
137
138                                     [% IF ( casServerUrl ) %]
139                                        <p><a href="[% casServerUrl | $raw %]">Log in using a CAS account.</a><p>
140                                     [% END %]
141
142                                     [% IF ( casServersLoop ) %]
143                                         <p>If you have a CAS account, please choose against which one you would like to authenticate:</p>
144                                         <ul>
145                                             [% FOREACH casServer IN casServersLoop %]
146                                             <li><a href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
147                                             [% END %]
148                                         </ul>
149                                     [% END %]
150                                 [% END # /IF shibbolethAuthentication %]
151
152                                 [% IF ( shibbolethAuthentication ) %]
153                                     <p>Nothing</p>
154                                 [% ELSE %]
155                                     <h2>Local login</h2>
156                                     <p>If you do not have a CAS account, but do have a local account, you can still log in: </p>
157                                 [% END %]
158
159                             [% END # / IF casAuthentication %]
160
161                             [% SET identity_providers = AuthClient.get_providers('opac') %]
162                             [% IF ( ! identity_providers.empty ) %]
163                                 [% FOREACH provider IN identity_providers %]
164                                     <p class="clearfix">
165                                         <a href="[% provider.url | url %]" class="btn btn-light col-md-12" id="provider_[% provider.code | html %]">
166                                             [% IF provider.icon_url %]
167                                                 <img src="[% provider.icon_url | url %]" style="max-height: 20px; max-width: 20px;"/>
168                                             [% ELSE %]
169                                             <i class="fa fa-user" aria-hidden="true"></i>
170                                             [% END %]
171                                             Log in with [% provider.description | html %]
172                                         </a>
173                                     </p>
174                                 [% END %]
175                                 <hr/>
176                                 <p>If you do not have an external account, but do have a local account, you can still log in: </p>
177                             [% END # /IF  identity_providers %]
178
179                             [% IF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
180                                 [% IF ( invalidGoogleOpenIDConnectLogin ) %]
181                                     <h2>Google login</h2>
182                                     <p>Sorry, your Google login failed. <span class="error">[% invalidGoogleOpenIDConnectLogin | html %]</span></p>
183                                     <p>Please note that the Google login will only work if you are using the e-mail address registered with this library.</p>
184                                     <p>If you want to, you can try to <a href="/cgi-bin/koha/svc/auth/googleopenidconnect?reauthenticate=select_account">log in using a different account</a>
185                                 [% END %]
186                                 <a href="/cgi-bin/koha/svc/auth/googleopenidconnect" class="btn btn-light" id="openid_connect"><i class="fa-brands fa-google" aria-hidden="true"></i> Log in with Google</a>
187                                 <p>If you do not have a Google account, but do have a local account, you can still log in: </p>
188                             [% END # /IF GoogleOpenIDConnect %]
189                         [% END # /UNLESS OPACShibOnly %]
190
191                         [% IF !(invalid_username_or_password || too_many_login_attempts) and password_has_expired %]
192                             <div class="alert alert-info">
193                                 <p><strong>Error: </strong>Your password has expired!</p>
194                             </div>
195                             [% IF Koha.Preference('EnableExpiredPasswordReset') %]
196                                 <a href="/cgi-bin/koha/opac-reset-password.pl">Reset your password</a>.
197                             [% ELSIF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
198                                 <div id="resetpassword">
199                                     <a href="/cgi-bin/koha/opac-password-recovery.pl">Reset your password</a>
200                                 </div>
201                             [% ELSE %]
202                                 <p>You must contact the library to reset your password</p>
203                             [% END %]
204                         [% ELSIF !Koha.Preference('OPACShibOnly') or SCO_login or SCI_login %]
205                             [% IF SCO_login %]
206                                 <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post" autocomplete="off">
207                             [% ELSIF SCI_login %]
208                                 <form action="/cgi-bin/koha/sci/sci-main.pl" name="auth" id="auth" method="post" autocomplete="off">
209                             [% ELSE %]
210                                 <form action="[% script_name | html %]" name="auth" id="auth" method="post" autocomplete="off">
211                             [% END %]
212                                 <input type="hidden" name="koha_login_context" value="opac" />
213
214                                 <div class="local-login">
215                                     <fieldset class="brief">
216                                         [% FOREACH INPUT IN INPUTS %]
217                                             [% NEXT IF INPUT.name == 'logout.x' %]
218                                             <input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]" />
219                                         [% END %]
220                                         <div class="form-group">
221                                             <label for="userid">Login:</label>
222                                             <input class="form-control" type="text"  size="25" id="userid"  name="userid" autocomplete="off" />
223                                         </div>
224                                         <div class="form-group">
225                                             <label for="password">Password:</label>
226                                             <input class="form-control" type="password"  size="25" id="password"  name="password" autocomplete="off" />
227                                         </div>
228                                         <fieldset class="action">
229                                             <input type="submit" value="Log in" class="btn btn-primary" />
230                                         </fieldset>
231                                     </fieldset>
232                                 </div>
233
234                                 <div id="nologininstructions">
235                                     [% IF OpacLoginInstructions %]
236                                         [% PROCESS koha_news_block news => OpacLoginInstructions %]
237                                     [% ELSE %]
238                                         <h2>Don't have a password yet?</h2>
239                                         <p>If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.</p>
240                                         <h2>Don't have a library card?</h2>
241                                         <p>If you don't have a library card, stop by your local library to sign up.</p>
242                                     [% END # / IF OpacLoginInstructions %]
243                                 </div>
244                                 [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
245                                     <div id="forgotpassword">
246                                         <p><a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a></p>
247                                     </div>
248                                 [% END %]
249                                 [% IF Koha.Preference('PatronSelfRegistration') && Categories.all( categorycode => Koha.Preference('PatronSelfRegistrationDefaultCategory') ).count %]
250                                     <div id="registrationinstructions">
251                                         <p><a href="/cgi-bin/koha/opac-memberentry.pl">Create an account</a></p>
252                                     </div>
253                                 [% END %]
254                             </form>
255                         [% END # / IF password_has_expired / ELSIF !OPACShibOnly or SCO_login or SCI_login %]
256                     [% END # / IF loginprompt %]
257
258                     [% ELSE %]
259                         <h1>Logging on to the catalog has not been enabled by the library.</h1>
260                         <ul>
261                             <li>To report this error, you can email the Koha Administrator. <a href="mailto:[% Koha.Preference( 'KohaAdminEmailAddress' ) | uri %]">Email</a></li>
262                             <li>Use top menu bar to navigate to another part of Koha.</li>
263                         </ul>
264                     [% END # / IF opacuserlogin %]
265
266                 </div> <!-- /.opac-auth -->
267             </div> <!-- /.col-md-10 col-lg-6 -->
268         </div> <!-- /.row -->
269     </div> <!-- /.container-fluid -->
270 </div> <!-- /.main -->
271
272 [% INCLUDE 'opac-bottom.inc' %]
273 [% BLOCK jsinclude %]
274 <script>
275     // Hide circular 'Log in to Your Account' link in opac-auth.pl
276     $(document).ready(function() {
277         if ( $("#auth" ) ) { $("#members ul li a").hide(); }
278     });
279 </script>
280 [% END %]