+[% USE Koha %]
+[% USE Branches %]
+[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha ›
[% IF ( nopermission ) %]Access denied[% END %]
[% IF ( timed_out ) %]Session timed out[% END %]
[% IF ( different_ip ) %]IP address change[% END %]
- [% IF ( invalid_username_or_password ) %]Invalid username or password[% END %]
+ [% IF too_many_login_attempts %]This account has been locked.
+ [% ELSIF invalid_username_or_password %]Invalid username or password[% END %]
[% IF ( loginprompt ) %]Log in to Koha[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="main_auth" class="main">
<div id="doc" class="yui-t7">
<div id="bd">
<div id="login">
<h1><a href="http://koha-community.org">Koha</a></h1>
[% IF ( nopermission ) %]
-<div id="login_error"><strong>Error:</strong> You do not have permission to access this page. <a href="/cgi-bin/koha/mainpage.pl?logout.x=1">Click to log out</a></div>
+<div id="login_error">
+ <strong>Error:</strong>
+ You do not have permission to access this page.
+</div>
+<p><strong>Log in as a different user</strong></p></h2>
[% END %]
[% IF ( timed_out ) %]
[% END %]
[% IF ( wrongip ) %]
-<div id="login_error"><strong>Error: </strong>Independent Branches and Autolocation are switched on and you are logging in with an IP address that doesn't match your branch. </div>
+<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>
[% END %]
-[% IF ( invalid_username_or_password ) %]
+[% IF too_many_login_attempts %]
+ <div id="login_error"><strong>Error: </strong>This account has been locked!</div>
+ [% IF Koha.Preference('OpacResetPassword') && Koha.Preference('OpacBaseURL') %]
+ <a href="[% Koha.Preference('OpacBaseURL') %]/cgi-bin/koha/opac-password-recovery.pl">You must reset your password</a>.
+ [% END %]
+[% ELSIF invalid_username_or_password %]
<div id="login_error"><strong>Error: </strong>Invalid username or password</div>
[% END %]
<!-- login prompt time-->
-<form action="[% url %]" method="post" name="loginform" id="loginform">
+<form action="[% script_name %]" method="post" name="loginform" id="loginform">
<input type="hidden" name="koha_login_context" value="intranet" />
[% FOREACH INPUT IN INPUTS %]
<input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" />
<input type="password" name="password" id="password" class="input" value="" size="20" tabindex="2" />
</p>
-[% IF ( AutoLocation ) %][% ELSE %]
-[% IF ( IndependantBranches ) %][% ELSE %]
-<p><label for="branch">Library:</label>
- <select name="branch" id="branch" class="input" tabindex="3">
- <option value="">My Library</option>
- [% FOREACH branchloo IN branchloop %]
- <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
- [% END %]
- </select>
- </p>[% END %]
- [% END %]
+[% UNLESS IndependentBranches %]
+ <p>
+ <label for="branch">Library:</label>
+ <select name="branch" id="branch" class="input" tabindex="3">
+ <option value="">My library</option>
+ [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
+ <option value="[% l.branchcode %]">[% l.branchname %]</option>
+ [% END %]
+ </select>
+ </p>
+[% END %]
<!-- <p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label></p> -->
<p class="submit"><input id="submit" type="submit" value="Login" tabindex="4" /></p>
</form>
+[% IF ( casAuthentication ) %]
+<h4>Cas login</h4>
+
+[% IF ( invalidCasLogin ) %]
+<!-- This is what is displayed if cas login has failed -->
+<p>Sorry, the CAS login failed.</p>
+[% END %]
+
+[% IF ( casServerUrl ) %]
+ <p><a href="[% casServerUrl %]">If you have a CAS account, please click here to login</a>.<p>
+[% END %]
+
+[% IF ( casServersLoop ) %]
+ <p>If you have a CAS account, please choose against which one you would like to authenticate:</p>
+<ul>
+ [% FOREACH casServer IN casServersLoop %]
+ <li><a href="[% casServer.value %]">[% casServer.name %]</a></li>
+ [% END %]
+[% END %]
+[% END %]
+
+[% IF ( nopermission ) %]
+ <p><a href="javascript:window.history.back()">[Previous page]</a>
+ <a href="/">[Main page]</a></p>
+[% END %]
+
+
<!--<ul> -->
-<!-- <li><a href="/cgi-bin/koha/lostpassword.pl" title="Password Lost and Found">Lost your password?</a></li> -->
+<!-- <li><a href="/cgi-bin/koha/lostpassword.pl" title="Password lost and found">Lost your password?</a></li> -->
<!-- </ul> -->
</div>
</div>
+[% MACRO jsinclude BLOCK %]
+ <script type="text/javascript">
+ $(document).ready( function() {
+ if ( document.location.hash ) {
+ $( '#loginform' ).append( '<input name="auth_forwarded_hash" type="hidden" value="' + document.location.hash + '"/>' );
+ }
+ });
+ </script>
+[% END %]
+<!-- the main div is closed in intranet-bottom.inc -->
[% INCLUDE 'intranet-bottom.inc' %]