Server side sorting is useful when network traffic costs more than processing time.
The server side sorting control in conjunction with the virtual list view control returns only a subset of entries to the client. In the PHP Manual is stated that is possible to set ldap controls using the ldap_set_option directive. This however does not seem to work. The code I used to try this is below. I would like to know if anyone has tried it successfully or has any experience in setting up server side controls through php. Thanks anyway -----Original Message----- From: Stig Venaas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 28, 2001 10:31 AM To: Christos Sintoris Cc: [EMAIL PROTECTED] Subject: Re: [PHP] LDAP server side sorting Hi On Tue, Nov 27, 2001 at 04:08:39PM +0200, Christos Sintoris wrote: > Does anybody know how to call ldap_set_option in order to use server side > sorting? > > using: > $sortval="{'cn', 0,1}"; > $ctrl1 = array("oid" => "1.2.840.113556.1.4.473", "value" =>$sortval); > ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array($ctrl1)); > > reports success, but ldap_get_option() returns nothing and a subsequend > ldap_search > returns protocol error. I use LDAP V3 (iPlanet). I think perhaps the control would have to be given as part of the search (which is not possible in PHP right now). Support for this might be added if several people find it useful. Why do you want server side sorting? How about sorting it on the client side? Next PHP release (in CVS now) will have a function ldap_sort() that helps you do it on the client. After the search, you can simply do ldap_sort($ds, $sr, "cn"); if you want to search on cn. Stig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]