projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eb69467
)
add objectclass and ability to have multiple comma-separated values to LDAP
author
ivan
<ivan>
Wed, 20 Nov 2002 21:13:52 +0000
(21:13 +0000)
committer
ivan
<ivan>
Wed, 20 Nov 2002 21:13:52 +0000
(21:13 +0000)
export
FS/FS/part_export.pm
patch
|
blob
|
history
FS/FS/part_export/ldap.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_export.pm
b/FS/FS/part_export.pm
index
79fe913
..
86bd424
100644
(file)
--- 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',
'userpassword $crypt_password',
'hint',
'answer $sec_phrase',
+ 'objectclass top,person,inetOrgPerson',
),
},
'radius' => { label=>'Export RADIUS attributes', type=>'checkbox', },
),
},
'radius' => { label=>'Export RADIUS attributes', type=>'checkbox', },
diff --git
a/FS/FS/part_export/ldap.pm
b/FS/FS/part_export/ldap.pm
index
6ff9abe
..
a285043
100644
(file)
--- 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 ) = @_;
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;
$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;
my $status = $ldap->add( $dn, attrs => [ %attrib ] );
die $status->error if $status->is_error;