Changed the module to use the LDAP Connection authentication parameters, if specified, for searching when authenticating anonymous registrations

This commit is contained in:
Frank Dillon 2005-05-10 18:06:28 +00:00
parent 85f2c3d65a
commit 9afcd91f96

View file

@ -55,7 +55,12 @@ sub _isValidLDAPUser {
}
if ($ldap = Net::LDAP->new($uri->host, (port=>$uri->port))) {
if ($ldap->bind) {
if($connection->{connectDn}) {
$auth = $ldap->bind(dn=>$connection->{connectDn}, password=>$connection->{identifier});
}else{
$auth = $ldap->bind;
}
if ($auth) {
$search = $ldap->search ( base=>$uri->dn, filter=>$connection->{ldapIdentity}."=".$session{form}{'authLDAP_ldapId'});
if (defined $search->entry(0)) {
if ($connection->{ldapUserRDN} eq 'dn') {