Suggested two methods for API.pm

RESOLVED FIXED

Status

Directory
PerLDAP
P3
normal
RESOLVED FIXED
19 years ago
19 years ago

People

(Reporter: Leif Hedstrom, Assigned: Leif Hedstrom)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

19 years ago
From: Dave Carrigan <Dave.Carrigan@cnpl.enbridge.com>

Index: Conn.pm
===================================================================
RCS file: /cvsroot/mozilla/directory/perldap/Conn.pm,v
retrieving revision 1.18.2.7
diff -u -b -u -r1.18.2.7 Conn.pm
--- Conn.pm     1998/09/29 07:20:29     1.18.2.7
+++ Conn.pm     1998/10/28 19:52:43
@@ -248,6 +248,26 @@
   return $entry;
 }

+sub compare {
+  my ($self, $dn, $attr, $value) = @_;
+  return ldap_compare_s($self->{"ld"}, $dn, $attr, $value) ==
LDAP_COMPARE_TRUE;
+}
+
+#############################################################################
+# Count the number of entries found in a search
+#
+sub countEntries {
+  my $self = shift;
+  if ($self->{"ldfe"} == 1)
+    {
+      return ldap_count_entries($self->{"ld"}, $self->{"ldres"});
+    }
+  else
+    {
+      return 0 unless $self->{"ldentry"};
+      return ldap_count_entries($self->{"ld"}, $self->{"ldentry"});
+    }
+}

 #############################################################################
 # Get an entry from the search, either the first entry, or the next entry,
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

19 years ago
Priority: P2 → P3

Comment 1

19 years ago
Setting all current Open/Normal to M4.

Comment 2

19 years ago
Clearing "M" field since Directory product is not used for 5.0 specific project
bug metrics and will mess up our queries on milestones.
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 3

19 years ago
I've added the compare method, but not the countEntries(). The latter will break
if/when we do asynchronous LDAP in v2.0, and for the time being, I think it's
better to leave it out. It is documented in the FAQ though.
You need to log in before you can comment on or make changes to this bug.