Updated LDAP code to be compatible with more modern OpenLDAP API