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