projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3c43c3
)
separate root and user dn in ldap export
author
ivan
<ivan>
Fri, 22 Nov 2002 07:50:26 +0000
(07:50 +0000)
committer
ivan
<ivan>
Fri, 22 Nov 2002 07:50:26 +0000
(07:50 +0000)
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
338b4e3
..
35e25d6
100644
(file)
--- a/
FS/FS/part_export.pm
+++ b/
FS/FS/part_export.pm
@@
-726,7
+726,8
@@
tie my %sqlmail_options, 'Tie::IxHash',
tie my %ldap_options, 'Tie::IxHash',
'dn' => { label=>'Root DN' },
tie my %ldap_options, 'Tie::IxHash',
'dn' => { label=>'Root DN' },
- 'password' => { label=>'Optional DN password' },
+ 'password' => { label=>'Root DN password' },
+ 'userdn' => { label=>'User DN' },
'attributes' => { label=>'Attributes',
type=>'textarea',
default=>join("\n",
'attributes' => { label=>'Attributes',
type=>'textarea',
default=>join("\n",
diff --git
a/FS/FS/part_export/ldap.pm
b/FS/FS/part_export/ldap.pm
index
a285043
..
68a6352
100644
(file)
--- 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->machine,
$self->option('dn'),
$self->option('password'),
+ $self->option('userdn'),
@_,
) or $queue;
}
sub ldap_insert { #subroutine, not method
@_,
) 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( $user
dn, $user
name_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}) ];
}
#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( $
user
dn, attrs => [ %attrib ] );
die $status->error if $status->is_error;
$ldap->unbind;
die $status->error if $status->is_error;
$ldap->unbind;