Bug 4994 - Net::LDAP returns lowercase names
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 13 Jul 2010 21:26:35 +0000 (23:26 +0200)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 13 Jul 2011 22:36:33 +0000 (10:36 +1200)
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@catalyst.net.nz>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
C4/Auth_with_ldap.pm

index 6ad17f7..462ff07 100644 (file)
@@ -216,7 +216,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 ''