[turba] Size limit exceeded warning?

John Dalbec jpdalbec at ysu.edu
Wed Sep 24 13:50:47 PDT 2003


The version of Turba that I have installed (RELENG CVS from around 
March) doesn't issue a warning message if I run an LDAP search that 
exceeds the server size limit.  Has anyone been able to modify Turba to 
do this?  I tried

--- search.php	Fri Apr 11 09:14:26 2003
+++ search.php  Wed Sep 24 15:03:18 2003
@@ -47,6 +47,9 @@
          Horde::raiseMessage(_("Failed to connect to the specified 
directory."), HORDE_ERROR);
      } else {
          if (is_object($results = $driver->search(array($criteria => 
$val)))) {
+            if ($driver->errno) {
+                Horde::raiseMessage(sprintf(_("LDAP Error %d: %s"), 
$driver->errno, $driver->errstr), HORDE_WARNING);
+            }
              if (!is_object($_SESSION['turba_search_results'])) {
                  $_SESSION['turba_search_results'] = new Turba_List();
              }

but PHP complains that $driver->errno is an "undefined property".  I 
then tried

--- lib/Driver/ldap.php	Wed Sep 24 16:05:07 2003
+++ lib/Driver/ldap.php	Wed Sep 24 15:34:05 2003
@@ -171,6 +171,8 @@
              $this->errstr = ldap_error($this->ds);
              // FIXME: raise an exception using PEAR error handling
              return array();
+        } elseif ($this->errno = ldap_errno($this->ds)) {
+            $this->errstr = ldap_error($this->ds);
          }

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

and now $driver->errno and $driver->errstr are blank.  I get the correct 
values in $this->errno and $this->errstr.  I tried issuing a 
raiseMessage unconditionally in search.php but this doesn't work since 
the displayed page is actually browse.php.
Any advice?
Thanks,
John Dalbec




More information about the turba mailing list