[turba] Suggestion for sizelimit

Andrew Morgan morgan at orst.edu
Wed Aug 13 16:32:25 PDT 2003



On Thu, 14 Aug 2003, Jan Schneider wrote:

> Zitat von Andrew Morgan <morgan at orst.edu>:
>
> > On Wed, 13 Aug 2003, Jan Schneider wrote:
> >
> > > Zitat von Andrew Morgan <morgan at orst.edu>:
> > >
> > > > 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::raiseMessage() in the RELENG versions,
> > > $notification->push() in the HEAD versions.
> > >
> > > Jan.
> >
> > Well, this is exactly what I was looking for, but I'm a little stuck.
> > The
> > design of Turba is such that I can't see how to get this warning message
> > to propogate to the user.  Here is what happens:
> >
> > 1. User is on the search.php page, enters some search parameters, and
> > submits the form.  The form action is also search.php.
> >
> > 2. Search.php does the search, and if there is no PEAR error raised, it
> > serializes the search results, puts them in the session, then redirects
> > the user to browse.php, where the results are displayed.
>
> That's the reason why the notification system has changed in the CVS HEAD
> versions.
>
> > So the warning message is generated in the call to search.php, but it
> > needs to be displayed on the browse.php page.
> >
> > Is there any reasonable way to do that?  I don't know enough about the
> > internals of Horde myself to answer.
>
> In HEAD this is no problem, just push the message on the notification stack
> and it will be displayed the next time the user sees a page.
> In the stable version this is more difficult, you'll need to somehow pass
> this information to the following page either by an url parameter or stored
> within the session.
>
> Btw, the HEAD versions are the ones that get actively developed, so please
> make sure that any patches that you send are against CVS HEAD. If you
> backport these patches to the RELENG versions also, fine.
>
> Jan.

Well, I'm not too worried about fixing this in RELENG myself, so I'd
rather not kludge something together.  I'll have a look at getting this
into HEAD though, where it should be a simple change.  Here is the current
code from HEAD:

        /* 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);


I don't have a HEAD installation anywhere, so maybe you can help me with
the details.  Here is roughly how it should look:

        /* 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);
        }

        if (ldap_errno($this->ds) != 0) {
            $notification->push(ldap_error($this->ds));
        }

        return $this->getResults($fields, $res);


I'm just taking a guess at how $notification->push() works...  :)

	Andy



More information about the turba mailing list