Koha/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt
Fridolyn SOMERS d1bec84142 Bug 11146: Show a go back link on no permission page
When a user does not have permissions for a page or module, the
authentication page is displayed with message

  "Error: You do not have permission to access this page.".

Most librarians uses the "previous page" button of their browser to
come back on the page they were before trying to get to the
non-permitted page.

This patch adds a button to help coming back to previous page.
It also changes the "Click to log out" link as a button.

Test plan :
- Define a user with staff permissions but no permission on tools module
- Login with this user
=> You get to intranet home page
- Edit URL to go to tools module : cgi-bin/koha/tools/tools-home.pl
=> You get a page with a red error message and 2 buttons "Previous page"
   and "Log out"
- Click on "Previous page"
=> Go get to intranet home page
- Edit URL to go to tools module : cgi-bin/koha/tools/tools-home.pl
- Click on "Log out" button
=> You are logged-out and get to authentication page : cgi-bin/koha/mainpage.pl?logout.x=1

Signed-off-by: Garming Sam <garming@catalyst.net.nz>

Works as intended.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-11-23 19:43:37 +00:00

81 lines
2.9 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo;
[% 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 ( loginprompt ) %]Log in to Koha[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<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.
</div>
<div id="onerror_actions">
<a href="javascript:window.history.back()" class="button">Previous page</a>
<a href="/cgi-bin/koha/mainpage.pl?logout.x=1" class="button">Log out</a>
</div>
[% END %]
[% IF ( timed_out ) %]
<div id="login_error"><strong>Error: </strong>Session timed out.<br /> Please log in again</div>
[% END %]
[% IF ( different_ip ) %]
<div id="login_error"><strong>Error: </strong>IP address has changed. Please log in again </div>
[% END %]
[% IF ( wrongip ) %]
<div id="login_error"><strong>Error: </strong>IndependentBranches and Autolocation are switched on and you are logging in with an IP address that doesn't match your library. </div>
[% END %]
[% IF ( 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">
<input type="hidden" name="koha_login_context" value="intranet" />
[% FOREACH INPUT IN INPUTS %]
<input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]" />
[% END %]
<p><label for="userid">Username:</label>
<input type="text" name="userid" id="userid" class="input focus" value="[% userid %]" size="20" tabindex="1" />
</p>
<p><label for="password">Password:</label>
<input type="password" name="password" id="password" class="input" value="" size="20" tabindex="2" />
</p>
[% IF ( AutoLocation ) %][% ELSE %]
[% IF ( IndependentBranches ) %][% 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 %]
<!-- <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>
<!--<ul> -->
<!-- <li><a href="/cgi-bin/koha/lostpassword.pl" title="Password lost and found">Lost your password?</a></li> -->
<!-- </ul> -->
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]