Bug 29924: Add password expiration feature
[koha-ffzg.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 password_has_expired %]
54     <div id="login_error"><strong>Error: </strong>Your password has expired!</div>
55     [% IF Categories.can_any_reset_password && Koha.Preference('OpacBaseURL') %]
56         <a href="[% Koha.Preference('OpacBaseURL') | url %]/cgi-bin/koha/opac-password-recovery.pl">You must reset your password</a>.
57     [% ELSE %]
58         <p>You must contact the library to have your password reset</p>
59     [% END %]
60 [% ELSIF invalid_username_or_password %]
61 <div id="login_error"><strong>Error: </strong>Invalid username or password</div>
62 [% END %]
63
64 [% IF (shibbolethAuthentication) %]
65 <!-- This is what is displayed if shib login has failed -->
66 [% IF (invalidShibLogin ) %]
67 <div id="login_error"><Strong>Error: </strong>Shibboleth login failed</div>
68 [% END %]
69 <p><a href="[% shibbolethLoginUrl | $raw %]">Log in using a Shibboleth account</a>.</p>
70 [% END %]
71
72 [% IF !TwoFA_prompt && !Koha.Preference('staffShibOnly') %]
73     <!-- login prompt time-->
74     <form action="[% script_name | html %]" method="post" name="loginform" id="loginform">
75         <input type="hidden" name="koha_login_context" value="intranet" />
76     [% FOREACH INPUT IN INPUTS %]
77         <input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]" />
78     [% END %]
79     <p><label for="userid">Username:</label>
80     <input type="text" name="userid" id="userid" class="input focus" value="[% userid | html %]" size="20" tabindex="1" autocomplete="off" />
81     </p>
82     <p><label for="password">Password:</label>
83     <input type="password" name="password" id="password" class="input" value="" size="20" tabindex="2" autocomplete="off" />
84     </p>
85
86     [% UNLESS IndependentBranches %]
87         <p>
88             <label for="branch">Library:</label>
89             <select name="branch" id="branch" class="input" tabindex="3">
90                 <option value="">My library</option>
91                 [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
92                     <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
93                  [% END %]
94             </select>
95         </p>
96
97         [% IF Koha.Preference('UseCirculationDesks') && Desks.all %]
98         <p>
99             <label for="desk">Desk:</label>
100             <select name="desk_id" id="desk_id" class="input" tabindex="3">
101                 <option id="nodesk" value="">---</option>
102                     [% FOREACH d IN Desks.all %]
103                     <option class="[% d.branchcode | html %]" value="[% d.desk_id | html %]" disabled >[% d.desk_name | html %]</option>
104                     [% END %]
105             </select>
106         </p>
107         [% END %]
108
109         [% IF Koha.Preference('UseCashRegisters') && Registers.all().size %]
110         <p>
111             <label for="register_id">Cash register:</label>
112             <select name="register_id" id="register_id" class="input" tabindex="4">
113                 <option id="noregister" value="" selected="selected">Library default</option>
114                 [% PROCESS options_for_registers registers => Registers.all() %]
115             </select>
116         </p>
117         [% END %]
118
119     [% END %]
120
121     <!-- <p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label></p> -->
122
123     <p class="submit"><input id="submit-button" type="submit" value="Log in" tabindex="4" /></p>
124     </form>
125
126     [% IF ( casAuthentication ) %]
127         <h4>Cas login</h4>
128
129         [% IF ( invalidCasLogin ) %]
130         <!-- This is what is displayed if cas login has failed -->
131         <p>Sorry, the CAS login failed.</p>
132         [% END %]
133
134         [% IF ( casServerUrl ) %]
135             <p><a href="[% casServerUrl | $raw %]">If you have a CAS account, please click here to login</a>.<p>
136         [% END %]
137
138         [% IF ( casServersLoop ) %]
139             <p>If you have a CAS account, please choose against which one you would like to authenticate:</p>
140         <ul>
141             [% FOREACH casServer IN casServersLoop %]
142                 <li><a href="[% casServer.value | $raw %]">[% casServer.name | html %]</a></li>
143             [% END %]
144         [% END %]
145     [% END %]
146 [% ELSIF TwoFA_prompt %]
147     <form action="[% script_name | html %]" method="post" name="loginform" id="loginform">
148         <input type="hidden" name="koha_login_context" value="intranet" />
149         [% FOREACH INPUT IN INPUTS %]
150             <input type="hidden" name="[% INPUT.name | html %]" value="[% INPUT.value | html %]" />
151         [% END %]
152         [% IF invalid_otp_token %]
153             <div id="login_error">Invalid two-factor code</div>
154         [% END %]
155
156         <p>
157             <label for="otp_token">Two-factor authentication code:</label>
158             <input type="text" name="otp_token" id="otp_token" class="input focus" value="" size="20" tabindex="1" />
159         </p>
160         <p>
161             <input id="submit-button" type="submit" value="Verify code" />
162             <a class="cancel" id="logout" href="/cgi-bin/koha/mainpage.pl?logout.x=1">Cancel</a>
163         </p>
164
165     </form>
166 [% END %]
167
168 [% IF ( nopermission ) %]
169     <p><a id="previous_page" href="javascript:window.history.back()">[Previous page]</a>
170     <a id="mainpage" href="/">[Main page]</a></p>
171 [% END %]
172
173
174 <!--<ul> -->
175 <!--    <li><a href="/cgi-bin/koha/lostpassword.pl" title="Password lost and found">Lost your password?</a></li> -->
176 <!-- </ul> -->
177
178 </div>
179
180 [% MACRO jsinclude BLOCK %]
181     [% Asset.js("js/desk_selection.js") | $raw %]
182     [% Asset.js("js/register_selection.js") | $raw %]
183     <script>
184         $(document).ready( function() {
185             if ( document.location.hash ) {
186                 $( '#loginform' ).append( '<input name="auth_forwarded_hash" type="hidden" value="' + document.location.hash + '"/>' );
187             }
188             // Clear last borrowers, rememberd sql reports, carts, etc.
189             logOut();
190         });
191     </script>
192 [% END %]
193 <!-- the main div is closed in intranet-bottom.inc -->
194 [% INCLUDE 'intranet-bottom.inc' %]