Zhang Huangbin wrote:
> 
> Does anyone has working code snippet of server/client side sorting?
> 
> I use serverctrls in search_ext_s() like this:
> 
>   search_ext_s(xxxx, serverctrls = [ 
> ldap.controls.LDAPControl('1.2.840.113556.1.4.473',1,None) ],)
> 
> got error msg:
> 
>   UNAVAILABLE_CRITICAL_EXTENSION: {'info': 'critical extension is not 
> recognized', 'desc': 'Critical extension is unavailable'}
> 
> * Use clientctrls:
> 
>   search_ext_s(xxxx, clientctrls = [ 
> ldap.controls.LDAPControl('1.2.840.113556.1.4.473',1,None) ],)
> 
> got error msg:
> 
>   NOT_SUPPORTED: {'info': '', 'desc': 'Not Supported'}
> 
> My os is Ubuntu 9.04, OpenLDAP-2.4.15-1ubuntu3.

The error message is pretty clear: This particular LDAP server does not
support server-side sorting.

Besides that you should read RFC 2891 to learn how to generate the
controlValue which specifies which attribute and matching rule
(optional) is used for sorting and whether you want reverse order
(optional). You could try to generate the controlValue with module pyasn1.

Ciao, Michael.

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Python-LDAP-dev mailing list
Python-LDAP-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev

Reply via email to