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