lpt can add group and grant-mail works
This commit is contained in:
parent
de445361e8
commit
cc1b765e58
2 changed files with 28 additions and 24 deletions
|
|
@ -21,7 +21,7 @@ my $bindsecret = "";
|
|||
|
||||
sub ldap_get_password
|
||||
{
|
||||
return Password::get_password ".secret_ldap";
|
||||
return Password::get_password "/home/2014/mercie_d/.secret_ldap";
|
||||
}
|
||||
|
||||
our $secret_search = \&ldap_get_password;
|
||||
|
|
@ -123,9 +123,9 @@ sub get_dn($$@)
|
|||
|
||||
my $mesg = $ldap->search( # search
|
||||
base => "$dn",
|
||||
filter => "(objectClass=top)",
|
||||
filter => "(objectClass=*)",
|
||||
attrs => @_,
|
||||
scope => "base"
|
||||
scope => "sub"
|
||||
);
|
||||
if ($mesg->code != 0) { log(WARN, $mesg->error); return undef; }
|
||||
if ($mesg->count != 1) { log(WARN, "$dn not found or multiple entries match"); return undef; }
|
||||
|
|
@ -235,6 +235,8 @@ sub get_attribute($$$)
|
|||
my $dn = shift;
|
||||
my $what = shift;
|
||||
|
||||
if (!$dn) { return undef; }
|
||||
|
||||
return get_dn($ldap, $dn, $what)->get_value($what);
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue