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