[Koha-patches] [Signed Off] [PATCH] Bug 4994 - Net::LDAP returns lowercase names

Chris Cormack chrisc at catalyst.net.nz
Tue May 10 00:05:48 CEST 2011


From: Dobrica Pavlinusic <dpavlin at rot13.org>

This requires us to specify all LDAP mappings in koha-conf.xml in lowercase,
instead of original case used withing LDAP.

Compare readability of

<userid      is="hrEduPersonUniqueID"  ></userid>

(which doesn't work) with required (and non-intuitive)

<userid      is="hredupersonuniqueid"  ></userid>

Signed-off-by: Chris Cormack <chrisc at catalyst.net.nz>
---
 C4/Auth_with_ldap.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/C4/Auth_with_ldap.pm b/C4/Auth_with_ldap.pm
index 3613acf..02f664b 100644
--- a/C4/Auth_with_ldap.pm
+++ b/C4/Auth_with_ldap.pm
@@ -210,7 +210,7 @@ sub ldap_entry_2_hash ($$) {
 	$debug and print STDERR "Finsihed \%memberhash has ", scalar(keys %memberhash), " keys\n",
 					"Referencing \%mapping with ", scalar(keys %mapping), " keys\n";
 	foreach my $key (keys %mapping) {
-		my  $data = $memberhash{$mapping{$key}->{is}}; 
+		my  $data = $memberhash{ lc($mapping{$key}->{is}) }; # Net::LDAP returns all names in lowercase
 		$debug and printf STDERR "mapping %20s ==> %-20s (%s)\n", $key, $mapping{$key}->{is}, $data;
 		unless (defined $data) { 
 			$data = $mapping{$key}->{content} || '';	# default or failsafe ''
-- 
1.7.4.1



More information about the Koha-patches mailing list