2013/1/7 Brian Gaber <[email protected]>:
> I have OpenLDAP ldap with many groupOfNames groups. I want to determine if a
> user is a member of a specific group.
>
> I would like return a True or False whether user is a member of group or not.
You can use the compare operation. See perldoc Net::LDAP :
compare ( DN, OPTIONS )
Compare values in an attribute in the entry given by "DN"
on the server. "DN" may be a string or a
Net::LDAP::Entry object.
attr => ATTR
The name of the attribute to compare.
value => VALUE
The value to compare with.
control => CONTROL
control => [ CONTROL, ... ]
See "CONTROLS" below.
callback => CALLBACK
See "CALLBACKS" below.
Example
$mesg = $ldap->compare( $dn,
attr => 'cn',
value => 'Graham Barr'
);
Clément.