Browse Source

* LDV::LDAP : reorder functions

master
Alex 'AdUser' Z 10 years ago
parent
commit
793b097819
  1. 43
      lib/LDV/LDAP.pm

43
lib/LDV/LDAP.pm

@ -62,28 +62,8 @@ sub create {
sn => 'just',
cn => 'created',
]);
return $result->error if ($result->code);
$conn->unbind;
return;
}
sub update {
my ($self, $uid, $attrs) = @_;
return "Attrs isn't HASH"
if (ref($attrs) ne 'HASH');
my $conn = $self->_connect();
$uid = $self->_escape($uid);
my $data = $self->get($uid);
return "No such user"
unless ($data);
my $dn = sprintf "uid=%s,%s", $uid, $self->{userbase};
foreach my $key (keys($attrs)) {
...
}
return $result->error if ($result->code);
return;
}
@ -94,6 +74,7 @@ sub delete {
my $dn = sprintf "uid=%s,%s", $uid, $self->{userbase};
my $result = $conn->delete($dn);
$conn->unbind;
return $result->error if ($result->code);
return;
}
@ -115,4 +96,24 @@ sub get {
return $data;
}
sub update {
my ($self, $uid, $attrs) = @_;
return "Attrs isn't HASH"
if (ref($attrs) ne 'HASH');
my $conn = $self->_connect();
$uid = $self->_escape($uid);
my $data = $self->get($uid);
return "No such user"
unless ($data);
my $dn = sprintf "uid=%s,%s", $uid, $self->{userbase};
foreach my $key (keys($attrs)) {
...
}
return;
}
1;

Loading…
Cancel
Save