[turba] Re: LDAP scope

Craig White craigwhite at azapple.com
Mon Feb 21 20:49:37 PST 2005


On Mon, 2005-02-21 at 20:23 -0700, Craig White wrote:
> On Mon, 2005-02-21 at 21:32 -0500, Edward Rudd wrote:
> > On Sun, 20 Feb 2005 19:03:44 -0700, Craig White wrote:
> > 
> > > [snip]
> > > I would rather move my user address books to an entirely different
> > > contain than do that as sub searching even with additional restrictions
> > > on the filters is if nothing else a waste of time/resources and not
> > > necessary.
> > > 
> > > a quick search of horde/turba/lib/Driver/ldap.php doesn't reveal
> > > anything like a scope option which confuses me - as scopes are one of
> > > the basic elements of ldapsearch functions.
> > 
> > the PHP LDAP api is rather awkward is where the issue is. PHP has 3
> > functions to search a directory.
> > 
> > ldap_search  => which is the same as scope=sub
> > ldap_list => which is the same as scope=one
> > ldap_read => which is the same as scope=base
> > 
> > So, basically a patch would have to be created against the
> > Drivers/ldap.php to provide the scope paramater option, and use the
> > appropriate function based on the scope.
> ----
> Excellent explanation -
> 
> just for S & G's
> 
> I changed the 1 instance of ldap_search to ldap_list in
> horde/turba/lib/Driver/ldap.php
> 
> and removed my 'filter' in horde/turba/config/sources.php that screened
> out the user address book entries and it surely worked...except for one
> thing...
> 
> when I did a 'search' from that same Address Book, it returned entries
> from user address books so that 'sub' scope returned once again, though
> I had removed it per above. Hmmm... 
> 
> Have to keep playing with this
----
OK - I actually think I may have discovered a bug in turba 

cd /var/www/html/horde/turba/lib/Driver
# cat CVS/Entries
/kolab.php/1.7/Sat Jan 15 20:26:56 2005//THEAD
/prefs.php/1.11/Sat Jan 15 20:26:56 2005//THEAD
/sql.php/1.62/Mon Jan 24 17:13:43 2005//THEAD
/imsp.php/1.25/Tue Feb 22 04:37:01 2005//THEAD
/ldap.php/1.58/Tue Feb 22 04:34:31 2005//THEAD

When I search an empty search (return all entries) in LDAP address book,
and then I switch LDAP address books and search an empty search again,
or search for a specific name, it still returns all of the entries and
won't stop returning all of the found entries until I log out (kill the
session).

This is using the supplied ldap.php (v 1.58 listed above) - not the one
I have been playing with though it does appear that by editing line 145
of this ldap.php by replacing ldap_search with ldap_list - it does the
scope 'one' search instead of the scope 'sub' search with no apparent
problems other than the above which happens regardless. I believe this
change to be beneficial to all users by the way.

Craig



More information about the turba mailing list