// create a pool of 5 connections
//anonymous database access with write rights, probably not a good idea in practice ;)
project.appPool = new DbPool("ODBC","voting","","","",5,true);
//LDAP setup
//set to your LDAP host
project.host = "airwolf";
//set to your LDAP port
project.port = 389;
//set to your Directory Base
//change to match your server's
project.searchBase = "o=airius.com"
//the Distinguished Name you are going to use
//project.mgr_dn = "";
//Password for the Distinguished Name
//maybe blank for mgr_dn & mgr_pw if directory allows anonymous searches
//project.mgr_pw = "";
// Grab an LDAP object
var ldap = new LDAP(project.host,parseInt(project.port),project.searchBase,parseInt(0),
project.mgr_dn,project.mgr_pw);
//LDAP setup - note the settings below reflect the default NDS installation
//set to your LDAP host
project.host = "airwolf";
//set to your LDAP port
project.port = 389;
//set to your Directory Base
//change to match your server's
project.searchBase = "o=airius.com"
//the Distinguished Name you are going to use
//project.mgr_dn = "";
//Password for the Distinguished Name
//maybe blank for mgr_dn & mgr_pw if directory allows anonymous searches
//project.mgr_pw = "";
// Grab an LDAP object
var ldap = new LDAP(project.host,parseInt(project.port),project.searchBase,parseInt(0),
project.mgr_dn,project.mgr_pw);
debug("set ldap"+ldap);
//authenticate if necessary
//ldap.authenticate(project.mgr_dn,project.mgr_pw);
//set your scope
ldap.setSearchScope(parseInt(ldap.SCOPE_SUB));
// The redirect in the following code is irrelevant when this initial page is
// called during app or server startup. In order to make better use of the code,
// I've included it so that I can reuese the code should "project.ldap" need
// to be reinitialized.
// Thus, In the start page (login.htm) I've included the following lines:
// if (project.ldap == void(0)){
// redirect('init.htm');
// }
// This checks for the existance of 'project.ldap' and redirects back to this page
// if needed.
if (ldap == null){
/* connection could not be made */
write("Failed to connect to LDAP server. See error log or Java Console ");
}
else{
/* store the connection in the project object. */
project.ldap = ldap;
redirect("login.htm");
}