Keeping it Simple for iChain Users
Novell Cool Solutions: Trench
By Andrew Rook
Reader Rating
from 3 ratings
|
Digg This -
Slashdot This
Posted: 18 Sep 2003 |
The Problem
When a iChain session times out and the user tries to request a page using the "POST" method, iChain comes back with a 409 error page. The user is unable to get to the login page unless they type in the URL of the original site -- again!
I needed a user-friendly way of getting the iChain login page back in front of the user, so they could re-authenticate (username/password) and get redirected to their target URL.
The Solution
I modified the default error page that ships with iChain (new code is shown in green, existing code is in red).
The PXYERR.HTM page can be found in the SYS:/ETC/PROXY/DATA/ERRPAGE/NLS/ENGLISH directory.
Edit the page Title tag to utilize the iChain generated status message <title><ERROR_STATUS></title> I take this status and use it inside a snippet of javascript code. Towards the end of the header section, add the following script containing a function to redirect the browser to the referring URL to get the appropriate iChain login page:
<script>
<!-- hide from non-Javascript aware browsers
error_status = document.title;
error_code = parseInt(error_status, 10);
function redirect(code, URL)
{
if (error_code == 409) window.location.href = URL;
}
// -->
</script>
Then in the first body statement, add an "onload" command <body bgcolor="white" onload="if (error_code > 200 ) redirect(error_code, document.URL)">
You then need to change the error status message for all errors other than 409 from iChain variable:
<font color="#ff0033" face="Comic Sans MS"><b>: </b></font><font color="black" face="Comic Sans MS"><ERROR_STATUS> </font> to the javascript variable declared in the header (drawn from the page title) <font color="#ff0033" face="Comic Sans MS"><b>: </b></font><font color="black" face="Comic Sans MS"><script>document.write(error_status)</script></font>
You can download a copy of my complete PXYERR.HTM file here.
For further information about customizing proxy error pages, check out TID-2957391.
Reader Comments
- Exactly the problem just raised to me from a Senior VP. Thanks for having this so readily evailable.
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com
