diff options
author | ivan <ivan> | 2002-11-22 07:50:23 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-11-22 07:50:23 +0000 |
commit | 7a94fd2dd84ccb204e97e8cbd9ce4162e93fd12e (patch) | |
tree | 0741836ce91aaa4d3f46090949bb290424a3df8d /FS/FS/part_export/ldap.pm | |
parent | 66c7798152b9abecd00727d4814af5c10bcc84b3 (diff) |
separate root and user dn in ldap export
Diffstat (limited to 'FS/FS/part_export/ldap.pm')
-rw-r--r-- | FS/FS/part_export/ldap.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/FS/FS/part_export/ldap.pm b/FS/FS/part_export/ldap.pm index a285043..68a6352 100644 --- a/FS/FS/part_export/ldap.pm +++ b/FS/FS/part_export/ldap.pm @@ -201,21 +201,23 @@ sub ldap_queue { $self->machine, $self->option('dn'), $self->option('password'), + $self->option('userdn'), @_, ) or $queue; } sub ldap_insert { #subroutine, not method - my $ldap = ldap_connect(shift, (my $dn = shift), shift); - my( $username_attrib, %attrib ) = @_; + my $ldap = ldap_connect(shift, shift, shift); + my( $userdn, $username_attrib, %attrib ) = @_; - $dn = "$username_attrib=$attrib{$username_attrib}, $dn" if $username_attrib; + $userdn = "$username_attrib=$attrib{$username_attrib}, $userdn" + 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 ] ); + my $status = $ldap->add( $userdn, attrs => [ %attrib ] ); die $status->error if $status->is_error; $ldap->unbind; |