[turba] Re: Suggestion for sizelimit
Claudio Santana
csantana at imsa.edu
Wed Aug 13 11:43:49 PDT 2003
The current code in CVS is this one:
/* Send the query to the LDAP server and fetch the matching
entries. */
if (!($res = @ldap_search($this->ds, $this->root, $filter,
$attr, 0, $sizelimit))) {
$this->errno = ldap_errno($this->ds);
$this->errstr = ldap_error($this->ds);
return PEAR::raiseError($this->errstr);
}
return $this->getResults($fields, $res);
It actually rises the Pear error, but is still not taking care of the
user's notification that he is just receiving a partial result. In the
other hand, at this point I am not pretty sure if this validation is
possible, in the PHP documentation of the errors list for ldapsearch
function, the error code that I think corresponds to this error is:
// Not used in LDAPv3
LDAP_PARTIAL_RESULTS 0x09
But it has that comment on top of it that says it is not used in LDAPv3.
And the RFC 2251 published on Dec 1997 for LDAPv3 says that the result
code 9 is now reserved (http://www.ietf.org/rfc/rfc2251.txt). So, my
next question would be is there a reliable way of finding out that you
receive just the parcial result of a given query because of the
sizelimit parameter in the latest LDAP versions? Any suggestions or
comments?
Claudio Santana.
Andrew Morgan wrote:
>
> On Tue, 12 Aug 2003, Claudio Santana wrote:
>
>
>>Hi all,
>>
>> I'm trying to implement a production site with the latest version of
>>IMP/Turba with LDAP. I'm worried about users running queries with too
>>big results. I see there is a sizelimit parameter that limits the size
>>of the result to a given number of records in the search function. My
>>concern is that the user never gets any feedback message telling him
>>that he is just seeing a subset of the original result and he better
>>narrows the search. Is anybody working on something similar? Is anybody
>>else interested in having this feature implemented?
>>
>>Claudio Santana.
>
>
> When I implemented the sizelimit stuff in the stable branch, I seem to
> remember that the horde framework didn't have a way to return a "warning"
> message to the user. Here is the relevant bit of code:
>
> /* Send the query to the LDAP server and fetch the matching entries. */
> if (!($res = @ldap_search($this->ds, $this->root, $filter, $attr, 0, $sizelimit))) {
> $this->errno = ldap_errno($this->ds);
> $this->errstr = ldap_error($this->ds);
> // FIXME: raise an exception using PEAR error handling
> return array();
> }
>
> return $this->getResults($fields, $res);
>
> In the case of a sizelimit violation, the server will return the first
> sizelimit entries to the client AND set an error code (20 decimal, if
> memory serves me). The code above only checks for an error if the result
> set is false.
>
> Even if you rewrote that to always check the error code, how would you get
> an error message back to the user? This is more a question for the
> Horde/Turba developers I think, as the FIXME above suggests that this code
> is not written yet. :)
>
> Andy
>
>
More information about the turba
mailing list