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