Bug 18314: Account lockout
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / auth.tt
1 [% USE Koha %]
2 [% USE Branches %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; 
6     [% IF ( nopermission ) %]Access denied[% END %]
7     [% IF ( timed_out ) %]Session timed out[% END %]
8     [% IF ( different_ip ) %]IP address change[% END %]
9     [% IF too_many_login_attempts %]This account has been locked.
10     [% ELSIF invalid_username_or_password %]Invalid username or password[% END %]
11     [% IF ( loginprompt ) %]Log in to Koha[% END %]
12 </title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 </head>
15 <body id="main_auth" class="main">
16
17 <div id="doc" class="yui-t7">
18    <div id="bd">
19
20 <div id="login">
21 <h1><a href="http://koha-community.org">Koha</a></h1>
22 [% IF ( nopermission ) %]
23 <div id="login_error">
24     <strong>Error:</strong>
25     You do not have permission to access this page.
26 </div>
27 <p><strong>Log in as a different user</strong></p></h2>
28 [% END %]
29
30 [% IF ( timed_out ) %]
31 <div id="login_error"><strong>Error: </strong>Session timed out.<br /> Please log in again</div>
32 [% END %]
33
34 [% IF ( different_ip ) %]
35 <div id="login_error"><strong>Error: </strong>IP address has changed. Please log in again </div>
36 [% END %]
37
38 [% IF ( wrongip ) %]
39 <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>
40 [% END %]
41
42 [% IF too_many_login_attempts %]
43 <div id="login_error"><strong>Error: </strong>This account has been locked!</div>
44 [% ELSIF invalid_username_or_password %]
45 <div id="login_error"><strong>Error: </strong>Invalid username or password</div>
46 [% END %]
47
48 <!-- login prompt time-->
49 <form action="[% script_name %]" method="post" name="loginform" id="loginform">
50     <input type="hidden" name="koha_login_context" value="intranet" />
51 [% FOREACH INPUT IN INPUTS %]
52     <input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" />
53 [% END %]
54 <p><label for="userid">Username:</label>
55 <input type="text" name="userid" id="userid" class="input focus" value="[% userid %]" size="20" tabindex="1" />
56 </p>
57 <p><label for="password">Password:</label>
58 <input type="password" name="password" id="password" class="input" value="" size="20" tabindex="2" />
59 </p>
60
61 [% UNLESS IndependentBranches %]
62     <p>
63         <label for="branch">Library:</label>
64         <select name="branch" id="branch" class="input" tabindex="3">
65             <option value="">My library</option>
66             [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
67                 <option value="[% l.branchcode %]">[% l.branchname %]</option>
68             [% END %]
69         </select>
70     </p>
71 [% END %]
72
73 <!-- <p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label></p> -->
74
75 <p class="submit"><input id="submit" type="submit" value="Login" tabindex="4" /></p>
76 </form>
77 [% IF ( casAuthentication ) %]
78 <h4>Cas login</h4>
79
80 [% IF ( invalidCasLogin ) %]
81 <!-- This is what is displayed if cas login has failed -->
82 <p>Sorry, the CAS login failed.</p>
83 [% END %]
84
85 [% IF ( casServerUrl ) %]
86     <p><a href="[% casServerUrl %]">If you have a CAS account, please click here to login</a>.<p>
87 [% END %]
88
89 [% IF ( casServersLoop ) %]
90     <p>If you have a CAS account, please choose against which one you would like to authenticate:</p>
91 <ul>
92     [% FOREACH casServer IN casServersLoop %]
93         <li><a href="[% casServer.value %]">[% casServer.name %]</a></li>
94     [% END %]
95 [% END %]
96 [% END %]
97
98 [% IF ( nopermission ) %]
99     <p><a href="javascript:window.history.back()">[Previous page]</a>
100     <a href="/">[Main page]</a></p>
101 [% END %]
102
103
104 <!--<ul> -->
105 <!--    <li><a href="/cgi-bin/koha/lostpassword.pl" title="Password lost and found">Lost your password?</a></li> -->
106 <!-- </ul> -->
107
108 </div>
109 </div>
110
111 [% MACRO jsinclude BLOCK %]
112     <script type="text/javascript">
113         $(document).ready( function() {
114             if ( document.location.hash ) {
115                 $( '#loginform' ).append( '<input name="auth_forwarded_hash" type="hidden" value="' + document.location.hash + '"/>' );
116             }
117         });
118     </script>
119 [% END %]
120 <!-- the main div is closed in intranet-bottom.inc -->
121 [% INCLUDE 'intranet-bottom.inc' %]