Novell Home

Customizing iChain 2.0 Proxy Messages

Novell Cool Solutions: Tip
By Gustavo J Gallardo

Digg This - Slashdot This

Posted: 16 Apr 2002
 

Version: iChain 2.0

Gustavo Gallardo shares a tip on how to customize and/or translate iChain 2.0 proxy messages using javascript to make the modification in the user's browser.

I wrote these to be able to translate the messages in iChain 2.0 (the ones the proxy replaces on the fly). The same concept can also be used to customize the messages.

In the examples below, I changed the messages in English to the corresponding message in Spanish.

The pages below are only the "skeleton" HTML pages to easily read, understand and modify/customize to the customer environment.

iChain 2.0, allows the administrator to modify the login and error pages (see 'iChain 2.0 Administration Guide' -> 'Using and Tuning iChain Features' -> 'Custom Login Pages' and 'Appliance Error Messages').

The proxy software replaces the tags 'ERROR_STATUS' and 'ERROR_DESCRIPTION' with a hard coded message, depending on the situation. Unfortunately, those messages cannot be customized and/or translated.

These HTML examples below show how to overcome that limitation using javascript to make the modification in the user's browsers.

iChain Login Page: calogldp.htm

<HTML>
<HEAD>
<TITLE>iChain Login Page</TITLE>
</HEAD>

<BODY>
<SCRIPT>
error_status = "<ERROR_STATUS>";
switch (error_status){
case "Please log in":
ErrStat = "Por favor ingrese usuario y password";
break;
case "Login failed. Please try again.":
ErrStat = "El ingreso ha fallado, por favor intente nuevamente.";
break;
default:
ErrStat = error_stat;
}
</SCRIPT>

<FORM name="form1" ACTION="auth-up" METHOD="POST"
ENCTYPE="application/x-www-form-urlencoded">
<INPUT type="HIDDEN" name="url" SIZE="40" value="<ERROR_INFORMATION>" READONLY>
<INPUT type="HIDDEN" name="proxypath" value="<PROXY_PATH>">
<INPUT type="HIDDEN" name="context" value="default">

<script>document.write(ErrStat);</script>

<P>Username: <INPUT type="text" name="username"></P>
<P>Password: <INPUT type="PASSWORD" name="password"></P>
<INPUT type="SUBMIT" name="button" value="Login" class="buttontext">
</FORM>
</BODY>
</HTML>

iChain Error Page: pxyerr.htm

<HTML>
<HEAD>
<TITLE>iChain Error Page</TITLE>
</HEAD>

<BODY>
<SCRIPT>
error_stat = "<ERROR_STATUS>";
error_desc_full = "<ERROR_DESCRIPTION>";
error_desc = error_desc_full.substring(0,40);
switch (error_stat){
case "403 Forbidden":
ErrStat = "Acceso restringido (Error HTTP 403).";
break;
default:
ErrStat = error_stat;
}
switch (error_desc){
case "Your account has expired. Please contact":
ErrDesc = "Su acceso expiró. Por favor, contacte al help desk.";
break;
case "Your login capability is locked. Please ":
ErrDesc = "Por razones de seguridad, su acceso está bloqueado. Por favor, contacte al help desk";
break;
case "Organizational policies prohibit access ":
ErrDesc = "Esta página tiene restricción de acceso. Si usted debe acceder, solicite acceso llamando al help desk.";
break;
default:
ErrDesc = error_desc;
}
</SCRIPT>

<P>Error: <SCRIPT>document.write(ErrStat);</SCRIPT></P>
<P>Descripción: <SCRIPT>document.write(ErrDesc);</SCRIPT></P>
</BODY>
</HTML>


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell