Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use current methods and parameters

  • Loading branch information...
commit 96e9bb2b7bbd7f43b6a3cb218d953be38501c71b 1 parent f60cffb
@marschap marschap authored
Showing with 10 additions and 10 deletions.
  1. +4 −4 contrib/isMember.pl
  2. +6 −6 contrib/printMembers.pl
View
8 contrib/isMember.pl
@@ -4,7 +4,7 @@
#pass the common name of a group entry (assuming groupOfUniqueNames objectclass) and
#a uid, the script will tell you if the uid is a member of the group or not.
-$version = 3.0;
+$version = 3.0_01;
#in this version, the uid is a member of the given group if:
#are a member of the given group
@@ -52,7 +52,7 @@
my $ldap = new Net::LDAP ($opt_h, port=> $opt_p);
#will bind as specific user if specified else will be binded anonymously
-$ldap->bind(DN => $opt_D, password=> $opt_p) || die "failed to bind as $opt_D";
+$ldap->bind($opt_D, password=> $opt_p) || die "failed to bind as $opt_D";
#get user DN first
@@ -149,7 +149,7 @@ sub getIsMember
#check to see if our entry matches the search filter
- my $urlvalues = $entry->get("memberurl");
+ my $urlvalues = $entry->get_value("memberurl", asref => 1);
foreach my $urlval (@{$urlvalues})
{
@@ -184,7 +184,7 @@ sub getIsMember
} #end foreach
- my $membervalues = $entry->get("uniquemember");
+ my $membervalues = $entry->get_value("uniquemember", asref => 1);
foreach my $val (@{$membervalues})
{
View
12 contrib/printMembers.pl
@@ -48,7 +48,7 @@
my $ldap = new Net::LDAP ($opt_h, port=> $opt_p);
#will bind as specific user if specified else will be binded anonymously
-$ldap->bind(DN => $opt_D, password=> $opt_p) || die "failed to bind as $opt_D";
+$ldap->bind($opt_D, password=> $opt_p) || die "failed to bind as $opt_D";
#get the group DN
@@ -102,7 +102,7 @@ sub printMembers
print "\nMembers of group: $dn\n";
#returns an array reference
- my $values = $entry->get("uniquemember");
+ my $values = $entry->get_value("uniquemember", asref => 1);
foreach my $val (@{$values})
{
@@ -133,7 +133,7 @@ sub printMembers
if ($attr)
{
- my $values = $entry->get($attr);
+ my $values = $entry->get_value($attr, asref => 1);
foreach my $vals (@{$values})
{
@@ -145,7 +145,7 @@ sub printMembers
print "$val\n";
}
- my $values = $entry->get("objectclass");
+ my $values = $entry->get_value("objectclass", asref => 1);
# This value is also a group, print the members of it as well
@@ -153,7 +153,7 @@ sub printMembers
&printMembers($entry->dn(),$attr) if (grep /groupOfUniqueNames/i, @{$values});
};
}
- my $urls = $entry->get("memberurl");
+ my $urls = $entry->get_value("memberurl", asref => 1);
&printDynamicMembers($entry->dn(),$urls,$attr) if ($urls);
};
return 0;
@@ -211,7 +211,7 @@ sub printDynamicMembers
if ($attr)
{
- my $values = $entry->get($attr);
+ my $values = $entry->get_value($attr, asref => 1);
foreach my $vals (@{$values})
{
Please sign in to comment.
Something went wrong with that request. Please try again.