Archived
1
0
Fork 0

LPT: fix grant-lab and add delete account capability

This commit is contained in:
Mercier Pierre-Olivier 2013-11-07 14:46:28 +01:00
commit cda7b5b026
2 changed files with 98 additions and 16 deletions

View file

@ -193,9 +193,9 @@ sub get_dn($$@)
base => "$dn",
filter => Net::LDAP::Filter->new("(objectClass=*)"),
attrs => \@_,
scope => "sub"
scope => "base"
);
if ($mesg->code != 0) { log(WARN, $mesg->error); return undef; }
return undef if ($mesg->code != 0);
if ($mesg->count != 1) { log(WARN, "$dn not found or multiple entries match"); return undef; }
return $mesg->entry(0);
@ -331,7 +331,7 @@ sub search_dn($$@)
attrs => [ ],
scope => "sub"
);
croak($mesg->error) if ($mesg->code != 0);
return undef if ($mesg->code != 0);
croak("$filter not found") if ($mesg->count == 0);
croak("$filter not unique") if ($mesg->count > 1);