Re: [PHP] LDAP server side sorting

2001-11-28 Thread Stig Venaas

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]




RE: [PHP] LDAP server side sorting

2001-11-28 Thread Christos Sintoris


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]




Re: [PHP] LDAP server side sorting

2001-11-28 Thread Stig Venaas

On Wed, Nov 28, 2001 at 05:26:22PM +0200, Christos Sintoris wrote:
 
 Server side sorting is useful when network traffic costs more than
 processing time. 

Yes, there are some exceptions.

 The server side sorting control in conjunction with the virtual list
 view control returns only a subset of entries to the client. 

Yes.

 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.

I have, it works. If you were to use it for this, you would have to BER
encode a sequence and pass a string not an array. But that's not the
main problem. The way I interpret RFC 2891, the server side control is
to be sent along with the search operation, not as a individual
operation. This is not currently supported in PHP. I'm sort of planning
to implement it. I'm not able to test it though, if you or others know
of a publicly available server that I can test against, let me know
(okay, I could probably find one myself with some digging around).

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]




[PHP] LDAP server side sorting

2001-11-27 Thread Christos Sintoris

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).


Thanks

Christos Sintoris





-- 
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]