From fa97bbc58c661258038bed384b0800027b290909 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 5 Jun 2009 14:34:28 +0000 Subject: [PATCH] - Made a change to LDAP auth that adds an OR to that query so that it also searches for a row with fieldData REGEXP '^uid=(value-from-ldap-directory-server),'. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Group.pm | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index ef7013598..93ee78d85 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.7.10 + - Made a change to LDAP auth that adds an OR to that query so that it also searches for a row with fieldData REGEXP '^uid=(value-from-ldap-directory-server),'. (Wes Morgan) 7.7.9 - fixed #10266: Public Profile overrides Able to be friend diff --git a/lib/WebGUI/Group.pm b/lib/WebGUI/Group.pm index 4163e19ab..ddc8a9137 100644 --- a/lib/WebGUI/Group.pm +++ b/lib/WebGUI/Group.pm @@ -804,11 +804,14 @@ sub getLDAPUsers { foreach my $person (@{$people}) { $person =~ s/\s*,\s*/,/g; $person = lc($person); - my ($userId) = $self->session->db->quickArray("select userId from authentication where authMethod='LDAP' and fieldName='connectDN' and lower(fieldData)=?",[$person]); + my $personRegExp = "^uid=$person,"; + + my ($userId) = $self->session->db->quickArray("select userId from authentication where authMethod='LDAP' and fieldName='connectDN' and lower(fieldData) = ? OR lower(fieldData) REGEXP ?",[$person,$personRegExp]); + if($userId) { push(@ldapUsers,$userId); } else { - $self->session->errorHandler->warn("Could not find matching userId for dn $person in WebGUI for group $gid"); + $self->session->errorHandler->warn("Could not find matching userId for dn/uid $person in WebGUI for group $gid"); } }