Bug 27470: Improved link text for shibboleth login
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / auth.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% USE Desks %]
6 [% USE Categories %]
7 [% USE Registers %]
8 [% SET footerjs = 1 %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>
11     [% IF TwoFA_prompt %]Two-factor authentication[% END %]
12     [% IF ( loginprompt ) %]Log in to Koha[% END %]
13     [% IF too_many_login_attempts %]This account has been locked.
14     [% ELSIF invalid_username_or_password %]Invalid username or password[% END %]
15     [% IF ( different_ip ) %]IP address change[% END %]
16     [% IF ( timed_out ) %]Session timed out[% END %]
17     [% IF ( nopermission ) %]Access denied[% END %] &rsaquo; Koha
18 </title>
19 [% INCLUDE 'doc-head-close.inc' %]
20 </head>
21 <body id="main_auth" class="main_main-auth">
22
23 <div class="main container-fluid">
24
25 <div id="login">
26 <h1><a href="http://koha-community.org">Koha</a></h1>
27 [% IF (Koha.Preference('StaffLoginInstructions')) %]<div id="login_instructions">[% Koha.Preference('StaffLoginInstructions') | $raw %]</div>[% END %]
28 [% IF ( nopermission ) %]
29 <div id="login_error">
30     <strong>Error:</strong>
31     You do not have permission to access this page.
32 </div>
33 <p><strong>Log in as a different user</strong></p></h2>
34 [% END %]
35
36 [% IF ( timed_out ) %]
37 <div id="login_error"><strong>Error: </strong>Session timed out.<br /> Please log in again</div>
38 [% END %]
39
40 [% IF ( different_ip ) %]
41 <div id="login_error"><strong>Error: </strong>IP address has changed. Please log in again </div>
42 [% END %]
43
44 [% IF ( wrongip ) %]
45 <div id="login_error"><strong>Error: </strong>Autolocation is switched on and you are logging in with an IP address that doesn't match your library. </div>
46 [% END %]
47
48 [% IF too_many_login_attempts %]
49     <div id="login_error"><strong>Error: </strong>This account has been locked!</div>
50     [% IF Categories.can_any_reset_password && Koha.Preference('OpacBaseURL') %]
51         <a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-password-recovery.pl">You must reset your password</a>.
52     [% END %]
53 [% ELSIF invalid_username_or_password %]
54 <div id="login_error"><strong>Error: </strong>Invalid username or password</div>
55 [% END %]
56
57 [% IF (shibbolethAuthentication) %]
58 <!-- This is what is displayed if shib login has failed -->
59 [% IF (invalidShibLogin ) %]
60 <div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div>
61 [% END %]
62 <p><a href="[% shibbolethLoginUrl | $raw %]">Log in using a Shibboleth account</a>.</p>
63 [% END %]
64
65 [% IF !TwoFA_prompt && !Koha.Preference('staffShibOnly') %]
66     <!-- login prompt time-->
67     <form action="[% script_name | html %]" method="post" name="loginform" id="loginform">
68         <input type="hidden" name="koha_login_context" value="intranet" />
69     [% FOREACH INPUT IN INPUTS %]
70         <input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]" />
71     [% END %]
72     <p><label for="userid">Username:</label>
73     <input type="text" name="userid" id="userid" class="input focus" value="[% userid | html %]" size="20" tabindex="1" autocomplete="off" />
74     </p>
75     <p><label for="password">Password:</label>
76     <input type="password" name="password" id="password" class="input" value="" size="20" tabindex="2" autocomplete="off" />
77     </p>
78
79     [% UNLESS IndependentBranches %]
80         <p>
81             <label for="branch">Library:</label>
82             <select name="branch" id="branch" class="input" tabindex="3">
83                 <option value="">My library</option>
84                 [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
85                     <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
86                  [% END %]
87             </select>
88         </p>
89
90         [% IF Koha.Preference('UseCirculationDesks') && Desks.all %]
91         <p>
92             <label for="desk">Desk:</label>
93             <select name="desk_id" id="desk_id" class="input" tabindex="3">
94                 <option id="nodesk" value="">---</option>
95                     [% FOREACH d IN Desks.all %]
96                     <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" disabled >[% d.desk_name | html %]</option>
97                     [% END %]
98             </select>
99         </p>
100         [% END %]
101
102         [% IF Koha.Preference('UseCashRegisters') && Registers.all().size %]
103         <p>
104             <label for="register_id">Cash register:</label>
105             <select name="register_id" id="register_id" class="input" tabindex="4">
106                 <option id="noregister" value="" selected="selected">Library default</option>
107                 [% PROCESS options_for_registers registers => Registers.all() %]
108             </select>
109         </p>
110         [% END %]
111
112     [% END %]
113
114     <!-- <p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label></p> -->
115
116     <p class="submit"><input id="submit-button" type="submit" value="Log in" tabindex="4" /></p>
117     </form>
118
119     [% IF ( casAuthentication ) %]
120         <h4>Cas login</h4>
121
122         [% IF ( invalidCasLogin ) %]
123         <!-- This is what is displayed if cas login has failed -->
124         <p>Sorry, the CAS login failed.</p>
125         [% END %]
126
127         [% IF ( casServerUrl ) %]
128             <p><a href="[% casServerUrl | $raw %]">If you have a CAS account, please click here to login</a>.<p>
129         [% END %]
130
131         [% IF ( casServersLoop ) %]
132             <p>If you have a CAS account, please choose against which one you would like to authenticate:</p>
133         <ul>
134             [% FOREACH casServer IN casServersLoop %]
135                 <li><a href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
136             [% END %]
137         [% END %]
138     [% END %]
139 [% ELSIF TwoFA_prompt %]
140     <form action="[% script_name | html %]" method="post" name="loginform" id="loginform">
141         <input type="hidden" name="koha_login_context" value="intranet" />
142         [% FOREACH INPUT IN INPUTS %]
143             <input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]" />
144         [% END %]
145         [% IF invalid_otp_token %]
146             <div id="login_error">Invalid two-factor code</div>
147         [% END %]
148
149         <p>
150             <label for="otp_token">Two-factor authentication code:</label>
151             <input type="text" name="otp_token" id="otp_token" class="input focus" value="" size="20" tabindex="1" />
152         </p>
153         <p>
154             <input id="submit-button" type="submit" value="Verify code" />
155             <a class="cancel" id="logout" href="/cgi-bin/koha/mainpage.pl?logout.x=1">Cancel</a>
156         </p>
157
158     </form>
159 [% END %]
160
161 [% IF ( nopermission ) %]
162     <p><a id="previous_page" href="javascript:window.history.back()">[Previous page]</a>
163     <a id="mainpage" href="/">[Main page]</a></p>
164 [% END %]
165
166
167 <!--<ul> -->
168 <!--    <li><a href="/cgi-bin/koha/lostpassword.pl" title="Password lost and found">Lost your password?</a></li> -->
169 <!-- </ul> -->
170
171 </div>
172
173 [% MACRO jsinclude BLOCK %]
174     [% Asset.js("js/desk_selection.js") | $raw %]
175     [% Asset.js("js/register_selection.js") | $raw %]
176     <script>
177         $(document).ready( function() {
178             if ( document.location.hash ) {
179                 $( '#loginform' ).append( '<input name="auth_forwarded_hash" type="hidden" value="' + document.location.hash + '"/>' );
180             }
181             // Clear last borrowers, rememberd sql reports, carts, etc.
182             logOut();
183         });
184     </script>
185 [% END %]
186 <!-- the main div is closed in intranet-bottom.inc -->
187 [% INCLUDE 'intranet-bottom.inc' %]