<HTML>
<HEAD>
<!-- hide the script from old crappy browsers -->
<SCRIPT LANGUAGE="JavaScript">
function entry2str(entry){ var retstr = ""; var attrset = entry.getAttributeSet(); var entrydn = entry.getDN(); var attrsenum = attrset.getAttributes();
retstr = "DN: " + entrydn + "\n";
while (attrsenum.hasMoreElements()) { var attr = attrsenum.nextElement(); var attrname = attr.getName();
if (attrname != "objectClass") { retstr += attrname + ":\n"; var valuesenum = attr.getStringValues();
while (valuesenum.hasMoreElements()) { var strval = valuesenum.nextElement();
if (strval != null) { retstr += " " + strval + "\n"; } }}
}
return(retstr);
}
function ldapisgood(name)
{ var LDAPConnection = netscape.ldap.LDAPConnection; var ld = new LDAPConnection(); var filter = "(cn=" + name + ")";
// request permission from the LDAP server
netscape.security.PrivilegeManager.enablePrivilege("UniversalConnect");
// connect, authenticate to intranet LDAP server that uses an Informix7.2.2 backend
ld.connect("to.mcom.com",389,"","");
var res = ld.search("o=Ace Industry, c=US",
2, filter, null, false);
// search and print results
document.jlkform.jlkdisplay.value = entry2str(res.nextElement());
}</SCRIPT>
</HEAD>
<BODY >
<FORM NAME="jlkform">
<B>Name:</B>
<INPUT NAME="SearchForThis"><br><br>
<INPUT TYPE=BUTTON VALUE="LDAP is Good" onClick="ldapisgood(SearchForThis.value);">
<br><br>Results are below :: =<br>
<TEXTAREA NAME="jlkdisplay" ROWS=8 COLS=50>
</TEXTAREA><center>
</FORM>
</BODY>
</HTML>