From 719790c0a8351ce519827419dbf7e1a2a774fae4 Mon Sep 17 00:00:00 2001 From: Stef Date: Tue, 8 Jun 2004 19:24:58 +0000 Subject: Fixed bug where too many entries were read for a depth of 1 and 0 --- ChangeLog | 7 +++++++ build.xml | 2 +- build/.cvsignore | 3 +++ src/com/memberwebs/ldapxml/LXReader.java | 13 ++++++++++++- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 ChangeLog create mode 100644 build/.cvsignore diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..487cdb6 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,7 @@ +0.9.1 + - Fixed bug where LXReader would try to read an entire subtree + when only scope 'base' or 'onelevel' was required. + +0.9 + - Initial public release + - Documented properly and isolated dependencies diff --git a/build.xml b/build.xml index aa6096a..b495ece 100644 --- a/build.xml +++ b/build.xml @@ -2,7 +2,7 @@ - + diff --git a/build/.cvsignore b/build/.cvsignore new file mode 100644 index 0000000..5481bd5 --- /dev/null +++ b/build/.cvsignore @@ -0,0 +1,3 @@ +ldapxml-* +manifest +com diff --git a/src/com/memberwebs/ldapxml/LXReader.java b/src/com/memberwebs/ldapxml/LXReader.java index 420925a..50fa0a2 100644 --- a/src/com/memberwebs/ldapxml/LXReader.java +++ b/src/com/memberwebs/ldapxml/LXReader.java @@ -207,8 +207,19 @@ public class LXReader if(sort == null) cons.setMaxResults(last + 1); + int scope = LDAPConnection.SCOPE_SUB; + switch(specs.getDepth()) + { + case 0: + scope = LDAPConnection.SCOPE_BASE; + break; + case 1: + scope = LDAPConnection.SCOPE_ONE; + break; + } + // Search tree for entries - LDAPSearchResults results = m_connection.search(base, LDAPConnection.SCOPE_SUB, + LDAPSearchResults results = m_connection.search(base, scope, specs.getFilter(filter), attrs, false, cons); if(sort != null) -- cgit v1.2.3