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