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