Bug 28955: (follow-up) Set to fall back
[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 [% PROCESS 'html_helpers.inc' %]
6 [% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>
9 [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
10     Log in to your account
11 [% ELSE %]
12     Catalog login disabled
13 [% END %] &rsaquo;
14  [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog
15 </title>
16 [% INCLUDE 'doc-head-close.inc' %]
17 [% BLOCK cssinclude %][% END %]
18 </head>
19 [% INCLUDE 'bodytag.inc' bodyid='opac-login-page' bodyclass='scrollto' %]
20 [% INCLUDE 'masthead.inc' %]
21
22 <div class="main">
23     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
24         <ol class="breadcrumb">
25             <li class="breadcrumb-item">
26                 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
27             </li>
28             <li class="breadcrumb-item active">
29                 <a href="#" aria-current="page">Log in</a>
30             </li>
31         </ol>
32     </nav> <!-- /#breadcrumbs -->
33
34     <div class="container-fluid">
35         <div class="row justify-content-center">
36             <div class="col-md-10 col-lg-6">
37                 <div id="opac-auth" class="maincontent">
38                     <!--CONTENT-->
39                     [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
40                         [% IF ( nopermission ) %]
41                             <!-- This is what is displayed if user doesn't have permission -->
42                             <div class="alert alert-warning">
43                                 <h1>Access denied</h1>
44                                 <p>Sorry, the system doesn't think you have permission to access this page. </p>
45                                 [% IF SCO_login %]
46                                     <p><a href="/cgi-bin/koha/sco/sco-main.pl?logout.x=1">Log out and try again with a different user.</a></p>
47                                 [% ELSIF SCI_login %]
48                                     <p><a href="/cgi-bin/koha/sci/sci-main.pl?logout.x=1">Log out and try again with a different user.</a></p>
49                                 [% END %]
50                             </div>
51                         [% END %]
52
53                         [% IF ( loginprompt ) %]
54                             <!-- login prompt time-->
55                             <h1>Log in to your account</h1>
56
57                             [% IF ( timed_out ) %]
58                                 <!-- This is what is displayed if login has timed out -->
59                                 <div class="alert alert-info">
60                                     <p>Sorry, your session has timed out. Please log in again.</p>
61                                 </div>
62                             [% END %]
63
64                             [% IF ( different_ip ) %]
65                                 <!-- This is what is displayed if user doesn't have permission -->
66                                 <div class="alert alert-info">
67                                     <p>You are logging from a different IP address. Please log in again.</p>
68                                 </div>
69                             [% END %]
70
71
72                             [% IF invalid_username_or_password || too_many_login_attempts %]
73                                 <!-- This is what is displayed if user doesn't have permission or account is locked. (Do not expose more information than needed.) -->
74                                 <div class="alert alert-info">
75                                     <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>
76                                 </div>
77                             [% END %]
78
79                             [% IF ( shibbolethAuthentication ) %]
80                                 [% IF ( invalidShibLogin ) %]
81                                     <!-- This is what is displayed if shibboleth login has failed to match a koha user -->
82                                     <div class="alert alert-info">
83                                         <p>Sorry, your Shibboleth identity does not match a valid library identity.</p>
84                                         [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
85                                             [% IF ( casAuthentication ) %]
86                                                 [% IF ( invalidCasLogin ) %]
87                                                     <!-- This is what is displayed if cas login has failed -->
88                                                     <p>Sorry, the CAS login also failed. If you have a local login you may use that below.</p>
89                                                 [% ELSE %]
90                                                     <p>If you have a CAS account, you may use that below.</p>
91                                                 [% END %]
92                                             [% ELSE %]
93                                                 <p>If you have a local account, you may use that below.</p>
94                                             [% END %]
95                                         [% END %]
96                                     </div>
97                                 [% ELSE %]
98                                     <h2>Shibboleth Login</h2>
99                                     <p><a href="[% shibbolethLoginUrl | $raw %]">Log in using a Shibboleth account.</a></p>
100                                 [% END # /IF invalidShibLogin %]
101                                 [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
102                                     [% IF ( casAuthentication ) %]
103                                         <h2>CAS login</h2>
104                                         <p>If you do not have a Shibboleth account, but you do have a CAS account, you can use CAS.</p>
105                                     [% ELSE %]
106                                         <h2>Local login</h2>
107                                         <p>If you do not have a Shibboleth account, but you do have a local login, then you may login below.</p>
108                                     [% END %]
109                                 [% END %]
110                             [% END # /IF shibbolethAuthentication %]
111
112                         [% UNLESS ( Koha.Preference('OPACShibOnly') ) %]
113                             [% IF ( casAuthentication ) %]
114                                 [% IF ( shibbolethAuthentication ) %]
115                                     [% IF ( casServerUrl ) %]
116                                         <p><a href="[% casServerUrl | $raw %]">Log in.</a><p>
117                                     [% END %]
118
119                                     [% IF ( casServersLoop ) %]
120                                         <p>Please choose against which one you would like to authenticate: </p>
121                                         <ul>
122                                             [% FOREACH casServer IN casServersLoop %]
123                                                 <li><a href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
124                                             [% END %]
125                                         </ul>
126                                     [% END %]
127                                 [% ELSE %]
128                                     <h2>CAS login</h2>
129
130                                     [% IF ( invalidCasLogin ) %]
131                                         <!-- This is what is displayed if cas login has failed -->
132                                         <p>Sorry, the CAS login failed.</p>
133                                     [% END %]
134
135                                     [% IF ( casServerUrl ) %]
136                                        <p><a href="[% casServerUrl | $raw %]">Log in using a CAS account.</a><p>
137                                     [% END %]
138
139                                     [% IF ( casServersLoop ) %]
140                                         <p>If you have a CAS account, please choose against which one you would like to authenticate:</p>
141                                         <ul>
142                                             [% FOREACH casServer IN casServersLoop %]
143                                             <li><a href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
144                                             [% END %]
145                                         </ul>
146                                     [% END %]
147                                 [% END # /IF shibbolethAuthentication %]
148
149                                 [% IF ( shibbolethAuthentication ) %]
150                                     <p>Nothing</p>
151                                 [% ELSE %]
152                                     <h2>Local login</h2>
153                                     <p>If you do not have a CAS account, but do have a local account, you can still log in: </p>
154                                 [% END %]
155
156                             [% END # / IF casAuthentication %]
157
158                             [% IF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %]
159                                 [% IF ( invalidGoogleOpenIDConnectLogin ) %]
160                                     <h2>Google login</h2>
161                                     <p>Sorry, your Google login failed. <span class="error">[% invalidGoogleOpenIDConnectLogin | html %]</span></p>
162                                     <p>Please note that the Google login will only work if you are using the e-mail address registered with this library.</p>
163                                     <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>
164                                 [% END %]
165                                 <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>
166                                 <p>If you do not have a Google account, but do have a local account, you can still log in: </p>
167                             [% END # /IF GoogleOpenIDConnect %]
168                         [% END # /UNLESS OPACShibOnly %]
169
170                         [% IF !Koha.Preference('OPACShibOnly') or SCO_login or SCI_login %]
171                             [% IF SCO_login %]
172                                 <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post" autocomplete="off">
173                             [% ELSIF SCI_login %]
174                                 <form action="/cgi-bin/koha/sci/sci-main.pl" name="auth" id="auth" method="post" autocomplete="off">
175                             [% ELSE %]
176                                 <form action="[% script_name | html %]" name="auth" id="auth" method="post" autocomplete="off">
177                             [% END %]
178                                 <input type="hidden" name="koha_login_context" value="opac" />
179
180                                 <fieldset class="brief">
181                                     [% FOREACH INPUT IN INPUTS %]
182                                         [% NEXT IF INPUT.name == 'logout.x' %]
183                                         <input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]" />
184                                     [% END %]
185                                     <div class="form-group">
186                                         <label for="userid">Login:</label>
187                                         <input class="form-control" type="text"  size="25" id="userid"  name="userid" />
188                                     </div>
189                                     <div class="form-group">
190                                         <label for="password">Password:</label>
191                                         <input class="form-control" type="password"  size="25" id="password"  name="password" />
192                                     </div>
193                                     <fieldset class="action">
194                                         <input type="submit" value="Log in" class="btn btn-primary" />
195                                     </fieldset>
196                                 </fieldset>
197
198                                 <div id="nologininstructions">
199                                     [% IF OpacLoginInstructions %]
200                                         [% PROCESS koha_news_block news => OpacLoginInstructions %]
201                                     [% ELSE %]
202                                         <h2>Don't have a password yet?</h2>
203                                         <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>
204                                         <h2>Don't have a library card?</h2>
205                                         <p>If you don't have a library card, stop by your local library to sign up.</p>
206                                     [% END # / IF OpacLoginInstructions %]
207                                 </div>
208                                 [% IF Koha.Preference('OpacPasswordChange') && Categories.can_any_reset_password %]
209                                     <div id="forgotpassword">
210                                         <a href="/cgi-bin/koha/opac-password-recovery.pl">Forgot your password?</a>
211                                     </div>
212                                 [% END %]
213                                 [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]
214                                     <div id="registrationinstructions">
215                                         <span>
216                                             <a href="/cgi-bin/koha/opac-memberentry.pl">You may register here.</a>
217                                         </span>
218                                     </div>
219                                 [% END %]
220                             </form>
221                         [% END # / IF !OPACShibOnly or SCO_login or SCI_login %]
222                     [% END # / IF loginprompt %]
223
224                     [% ELSE %]
225                         <h1>Logging on to the catalog has not been enabled by the library.</h1>
226                         <ul>
227                             <li>To report this error, you can email the Koha Administrator.<a href="mailto:[% admin | uri %]">Email</a></li>
228                             <li>Use top menu bar to navigate to another part of Koha.</li>
229                         </ul>
230                     [% END # / IF opacuserlogin %]
231
232                 </div> <!-- /.opac-auth -->
233             </div> <!-- /.col-md-10 col-lg-6 -->
234         </div> <!-- /.row -->
235     </div> <!-- /.container-fluid -->
236 </div> <!-- /.main -->
237
238 [% INCLUDE 'opac-bottom.inc' %]
239 [% BLOCK jsinclude %]
240 <script>
241     // Hide circular 'Log in to Your Account' link in opac-auth.pl
242     $(document).ready(function() {
243         if ( $("#auth" ) ) { $("#members ul li a").hide(); }
244     });
245 </script>
246 [% END %]