[turba] Suggestion for sizelimit
Andrew Morgan
morgan at orst.edu
Tue Aug 12 15:43:19 PDT 2003
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