[turba] Turba 1.2-RC2

Andrew Morgan morgan at orst.edu
Mon Feb 24 18:03:52 PST 2003


Are you interested in the two patches attached to this email, which add
support for limiting the size of the ldap query?  These were against Turba
1.1, but they look like they will apply cleanly to 1.2rc2 except maybe the
offset.

	Andy

On Tue, 25 Feb 2003, Jan Schneider wrote:

> The Horde Team is pleased to announce the second and probably last release
> candidate for the Turba 1.2 release.  Barring any problems, this code will
> be released as Turba 1.2.  Testing is requested and comments are encouraged.
>
> For a list of what's new in this release:
>
>     http://cvs.horde.org/co.php/turba/docs/CHANGES?r=1.61.2.52
>
> You can obtain the code here:
>
>     ftp://ftp.horde.org/pub/turba/turba-1.2-RC2.tar.gz
>     http://ftp.horde.org/pub/turba/turba-1.2-RC2.tar.gz
>
> MD5 (turba-1.2-RC2.tar.gz) = 33f444f76717c90ad749311b3697083d
>
> Jan.
>
> --
> Turba mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: turba-unsubscribe at lists.horde.org
>
-------------- next part --------------
--- turba/config/sources.php.dist.orig	Tue Oct  8 10:26:28 2002
+++ turba/config/sources.php.dist	Tue Oct  8 10:27:28 2002
@@ -182,6 +182,7 @@
         'root' => 'dc=example,dc=com',
         'bind_dn' => 'cn=admin,ou=users,dc=example,dc=com',
         'bind_password' => '********',
+        'sizelimit' => 200,
         'dn' => array('cn'),
         'objectclass' => 'person',
         'version' => 3
-------------- next part --------------
--- turba/lib/Driver/ldap.php.orig	Tue Oct  8 09:34:04 2002
+++ turba/lib/Driver/ldap.php	Tue Oct  8 10:21:39 2002
@@ -159,13 +159,22 @@
             $attr[] = 'sn';
         }
 
+	/*
+	 * Add a sizelimit, if specified. Default is 0, which means no limit.
+	 * Note: You cannot override a server-side limit with this.
+	 */
+	$sizelimit = 0;
+	if (!empty($this->params['sizelimit'])) {
+	    $sizelimit = $this->params['sizelimit'];
+	}
+
         /* Log the query at a DEBUG log level. */
-        Horde::logMessage(sprintf('LDAP search by %s: root = %s (%s); filter = "%s"; attributes = "%s"',
-                                  Auth::getAuth(), $this->root, $this->server, $filter, implode(', ', $attr)),
+        Horde::logMessage(sprintf('LDAP search by %s: root = %s (%s); filter = "%s"; attributes = "%s"; sizelimit = %d',
+                                  Auth::getAuth(), $this->root, $this->server, $filter, implode(', ', $attr), $sizelimit),
                           __FILE__, __LINE__, LOG_DEBUG);
 
         /* Send the query to the LDAP server and fetch the matching entries. */
-        if (!($res = @ldap_search($this->ds, $this->root, $filter, $attr))) {
+        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


More information about the turba mailing list