33 |
# attributes which won't pass through DBI |
# attributes which won't pass through DBI |
34 |
my $sql_select = q{ |
my $sql_select = q{ |
35 |
select |
select |
36 |
userid as uid, |
trim(userid) as uid, |
37 |
firstname as givenName, |
firstname as givenName, |
38 |
surname as sn, |
surname as sn, |
39 |
concat( |
concat(firstname,' ',surname) as cn, |
40 |
firstname, |
|
41 |
' ', |
-- SAFEQ specific mappings from UMgr-LDAP.conf |
42 |
surname |
concat(firstname,' ',surname) as displayName, |
43 |
) as cn, |
cardnumber as otherPager, |
44 |
cardnumber as otherPager, |
email as mail, |
45 |
email as mail |
categorycode as organizationalUnit, |
46 |
|
borrowernumber as objectGUID, |
47 |
|
concat('/home/',borrowernumber) as homeDirectory |
48 |
from borrowers |
from borrowers |
49 |
}; |
}; |
50 |
|
|
51 |
# needed for where clause |
# needed for where clause |
52 |
my $sql_ldap_mapping = { |
my $sql_ldap_mapping = { |
53 |
'userid' => 'uid', |
'userid' => 'uid', |
54 |
|
'borrowernumber' => 'objectGUID', |
55 |
}; |
}; |
56 |
|
|
57 |
# attributes which are same for whole set, but somehow |
# attributes which are same for whole set, but somehow |
140 |
} |
} |
141 |
} |
} |
142 |
} elsif ( $how eq 'present' ) { |
} elsif ( $how eq 'present' ) { |
143 |
push @limits, __sql_column( $filter->{$how} ) . ' IS NOT NULL'; |
my $name = __sql_column( $filter->{$how} ); |
144 |
## XXX add and length(foo) > 0 to avoid empty strings? |
push @limits, "$name IS NOT NULL and length($name) > 1"; |
145 |
|
## XXX length(foo) > 1 to avoid empty " " strings |
146 |
} else { |
} else { |
147 |
warn "UNSUPPORTED: how $how ",dump( $filter ); |
warn "UNSUPPORTED: how $how ",dump( $filter ); |
148 |
} |
} |