summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2002-11-20 21:13:52 +0000
committerivan <ivan>2002-11-20 21:13:52 +0000
commit96c1150cabe382dbafbdc8f4e89a2719fe24d605 (patch)
tree394813cf364ca913cb2dd4a30f80f99701f33824 /FS
parenteb694678cbb835267b44c5eb9ff574ee1d7ce115 (diff)
add objectclass and ability to have multiple comma-separated values to LDAP
export
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_export.pm1
-rw-r--r--FS/FS/part_export/ldap.pm5
2 files changed, 6 insertions, 0 deletions
diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm
index 79fe91396..86bd4240e 100644
--- a/FS/FS/part_export.pm
+++ b/FS/FS/part_export.pm
@@ -745,6 +745,7 @@ tie my %ldap_options, 'Tie::IxHash',
'userpassword $crypt_password',
'hint',
'answer $sec_phrase',
+ 'objectclass top,person,inetOrgPerson',
),
},
'radius' => { label=>'Export RADIUS attributes', type=>'checkbox', },
diff --git a/FS/FS/part_export/ldap.pm b/FS/FS/part_export/ldap.pm
index 6ff9abe12..a28504313 100644
--- a/FS/FS/part_export/ldap.pm
+++ b/FS/FS/part_export/ldap.pm
@@ -208,7 +208,12 @@ sub ldap_queue {
sub ldap_insert { #subroutine, not method
my $ldap = ldap_connect(shift, (my $dn = shift), shift);
my( $username_attrib, %attrib ) = @_;
+
$dn = "$username_attrib=$attrib{$username_attrib}, $dn" if $username_attrib;
+ #icky hack, but should be unsurprising to the LDAPers
+ foreach my $key ( grep { $attrib{$_} =~ /,/ } keys %attrib ) {
+ $attrib{$key} = [ split(/,/, $attrib{$key}) ];
+ }
my $status = $ldap->add( $dn, attrs => [ %attrib ] );
die $status->error if $status->is_error;