From 9afcd91f96ca4be796cd4de56f5a27ca308cc6fc Mon Sep 17 00:00:00 2001 From: Frank Dillon Date: Tue, 10 May 2005 18:06:28 +0000 Subject: [PATCH] Changed the module to use the LDAP Connection authentication parameters, if specified, for searching when authenticating anonymous registrations --- lib/WebGUI/Auth/LDAP.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Auth/LDAP.pm b/lib/WebGUI/Auth/LDAP.pm index 5d360e731..82cb37d40 100644 --- a/lib/WebGUI/Auth/LDAP.pm +++ b/lib/WebGUI/Auth/LDAP.pm @@ -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') {