I have solved this by creating a LDAP lookup script which is called from a onchange event on the client side of open.inc.php.
I have created a new field called "userid" in the system which is the AD id for the user.
open.inc.php:
" onchange="updateUsername();" onblur="updateUsername();">
And at the end of the same file a javascript function using jquery which is called from the above:
function updateUsername(){
var returnldapdata;
var inputuserid = document.getElementById("userid").value;
var dataString = 'include/GetUserFromLdap.php?signum='+ inputsignum;
$.ajax({
type: "POST",
url: dataString,
success: function(returnedData) {
returnldapdata = $.parseJSON(returnedData); // store the data values inside the data var.
if ( returnldapdata.Error ) {
alert(returnldapdata.Error + ": " + inputuserid + " does not exists, please try again!");
document.getElementById("userid").value = "";
document.getElementById("name").value = "";
document.getElementById("email").value = "";
}
else {
document.getElementById("name").value = returnldapdata.fullname+"";
document.getElementById("email").value = returnldapdata.email+"";
}
}
});
}
I have the Name & Email fields still visible in the page but they are set to readonly.