View | Details | Raw Unified | Return to bug 8993
Collapse All | Expand All

(-)a/C4/LDAPTransform/RepeatableValues.pm (-1 / +29 lines)
Line 0 Link Here
0
- 
1
package C4::LDAPTransform::RepeatableValues;
2
3
use warnings;
4
use strict;
5
6
my $mapping = { qw/
7
    givenName       firstname
8
    sn              surname
9
    uid             userid
10
    mail            email
11
    categorycode    categorycode
12
    branchcode      branchcode
13
/ };
14
15
sub get_borrower {
16
    my $ldap_entry = shift;
17
    $ldap_entry->isa('Net::LDAP::Entry') or die "argument to transform get_borrower is not Net::LDAP::Entry";
18
19
    my $user = { column => {} };
20
21
    while (my ($from, $to) = each %$mapping) {
22
        my @vals = $ldap_entry->get_value( $from );
23
        $user->{column}->{$to} = $vals[0];
24
    }
25
26
    return $user;
27
}
28
29
1;

Return to bug 8993