Re: Minimum version of OpenLDAP libs for python-ldap 2.4.x?

2011-03-04 Thread Zhang Huangbin
On Mar 5, 2011, at 2:45 AM, Michael Ströder wrote: > Again it's time to think about the minimum required version of OpenLDAP libs > to be used for building upcoming python-ldap 2.4.0. Does it mean py-ldap-2.4.0 won't support OpenLDAP-2.3.x series? Debian 5, RHEL/CentOS 5 ships OpenLDAP-2.3.x.

Re: How to find groups(CN) which contains specific words?

2010-12-14 Thread Zhang Huangbin
C% ? LDAP search filter can be wild-card, use '*ABC*' instead. Reference: http://www.zytrax.com/books/ldap/apa/search.html -- Zhang Huangbin - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux, CentOS, Debian,

Can't install python-ldap from pypi.python.org

2010-10-27 Thread Zhang Huangbin
Hi, developers. I can't install python-ldap from pypi.python.org, will you consider fixing it? First of all, there's a compile issue with py-ldap-2.3.12 on RHEL/CentOS 5.x: http://marc.info/?t=12815231342&r=1&w=2 Old versions are not available: #---<--- # easy_install python-ldap==2.3.11 Se

Re: python-ldap-2.3.12: Compile error on CentOS 5.5, i386

2010-08-11 Thread Zhang Huangbin
On Aug 12, 2010, at 2:42 AM, Michael Ströder wrote: > > Looks like an older OpenLDAP release. Please try the patch below. > > Ciao, Michael. > > Index: Modules/constants.c > === > RCS file: /cvsroot/python-ldap/python-ldap/Modules/

python-ldap-2.3.12: Compile error on CentOS 5.5, i386

2010-08-10 Thread Zhang Huangbin
On Aug 9, 2010, at 11:43 PM, Michael Ströder wrote: > Find a new release of python-ldap: > > http://pypi.python.org/pypi/python-ldap/2.3.12 Compile error on CentOS 5.5, i386: # easy_install python-ldap==2.3.12 Searching for python-ldap==2.3.12 Reading http://cheeseshop.python.org/pypi/python-

Re: How can i add a booleanMatch type attribute

2010-01-31 Thread Zhang Huangbin
On Jan 31, 2010, at 10:58 PM, Michael Ströder wrote: > Zhang Huangbin wrote: >> How can i add a booleanMatch type attribute with py-ldap? > > Simply like any other attribute provided your attribute value is TRUE or > FALSE. Successed with modlist: ('amavisLoc

How can i add a booleanMatch type attribute

2010-01-30 Thread Zhang Huangbin
'Critical extension is unavailable'} I use amavisd-new attribute: attributetype ( 1.3.6.1.4.1.15312.2.2.1.19 NAME 'amavisLocal' DESC 'Is user considered local' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE ) -- Best

Re: Compile error on RHEL 5.3 (x86_64), python-ldap-2.3.10

2009-11-13 Thread Zhang Huangbin
On Nov 13, 2009, at 4:47 PM, Michael Ströder wrote: > > Sorry, please try again from HEAD. I fixed also another typo. It (HEAD) works now. :) -- Best Regards. Zhang Huangbin - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux, CentOS, Debian, Ubuntu: http://www.iredma

Re: Compile error on RHEL 5.3 (x86_64), python-ldap-2.3.10

2009-11-12 Thread Zhang Huangbin
n this function) Modules/constants.c:186: error: (Each undeclared identifier is reported only once Modules/constants.c:186: error: for each function it appears in.) error: command 'gcc' failed with exit status 1 -- Best Reg

Compile error on RHEL 5.3 (x86_64), python-ldap-2.3.10

2009-11-04 Thread Zhang Huangbin
WCTX’ undeclared (first use in this function) Modules/constants.c:184: error: (Each undeclared identifier is reported only once Modules/constants.c:184: error: for each function it appears in.) error: Setup script exited with error: command 'gcc' failed with exit status 1 ---- -- Be

How to modify several dn in one time

2009-11-03 Thread Zhang Huangbin
add: cn cn: newCN cn: newCN2 -- dn: cn=user01,dc=xxx,dc=xxx changetype: modify cn: newCN cn: newCN2 -- Best Regards. Zhang Huangbin - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux, CentOS, Debian, Ubuntu: http://www.ir

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Zhang Huangbin
On Sep 9, 2009, at 9:32 PM, Michael Ströder wrote: > Zhang Huangbin wrote: >> NO_SUCH_ATTRIBUTE: {'info': 'modify/delete: enabledService: no such >> value', 'desc': 'No such attribute'} > > This means the attribute 'enabledServic

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Zhang Huangbin
difyModlist Thanks very much. :) -- Best Regards. Zhang Huangbin - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux, CentOS, Debian, Ubuntu: http://www.iredmail.org/ -- Let Crystal Reports handle th

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Zhang Huangbin
On Sep 9, 2009, at 6:02 PM, Michael Ströder wrote: > Zhang Huangbin wrote: >> On Sep 9, 2009, at 4:54 PM, Michael Ströder wrote: >>>> If cn=cn2 is not exist, [(ldap.MOD_DELETE, 'cn', 'cn2')] will raise >>>> an >>>> error. >>

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Zhang Huangbin
elf.dn, [(ldap.MOD_DELETE, attr, value)]) return (True, 'SUCCESS') except ldap.NO_SUCH_ATTRIBUTE: return (True, 'SUCCESS') except Exception, e: return (False, str(e)) - Thanks very much :) --

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-08 Thread Zhang Huangbin
On Sep 9, 2009, at 1:32 PM, Zhang Huangbin wrote: > > I want to replace cn=cn2 by cn=cn4 if it exist, or add cn=cn4 > directly if 'cn=cn2' donesn't exist. > > If cn=cn2 is not exist, [(ldap.MOD_DELETE, 'cn', 'cn2')] will raise > an error.

What's the best way to replace value of attribute which can handle multiple values?

2009-09-08 Thread Zhang Huangbin
d cn=cn4, but can't delete 'cn=cn2'. Thanks very much. :) -- Best Regards. Zhang Huangbin - Open Source Mail Server Solution for Red Hat(R) Enterprise Linux, CentOS, Debian, Ubuntu: http://www.iredmail.org/ -

Typo error in Demo/Lib/ldap/async/deltree.py (2.3.9)

2009-07-31 Thread Zhang Huangbin
Hi, developers. There's an incorrect module name in Demo/Lib/ldap/async/deltree.py, it seems 'ldap.async.SearchHandler' should be replaced by 'ldap.async.AsyncSearchHandler'. python-ldap version: 2.3.9. Thanks for your hard work :) -- Best Regards. Zhang Hua

Re: Any example to display jpegPhoto?

2009-06-09 Thread Zhang Huangbin
use webpy framework, solved just like Ryan Lovett said. Related thread: http://groups.google.com/group/webpy/t/9f7fdff1c75f7e93 -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian, Ubuntu: + Homepage: http://code.google.com/p/iredmail/ + Fo

Re: Any example to display jpegPhoto?

2009-06-09 Thread Zhang Huangbin
Zhang Huangbin wrote: > Zhang Huangbin wrote: >>> Not sure what you really want to display and where. >>> >>> How about entry['jpegPhoto'][0].encode('base64') ? > > Still confused what data type it stored in LDAP. > Already base64 encoded

Re: Any example to display jpegPhoto?

2009-06-09 Thread Zhang Huangbin
Zhang Huangbin wrote: >> Not sure what you really want to display and where. >> >> How about entry['jpegPhoto'][0].encode('base64') ? Still confused what data type it stored in LDAP. Already base64 encoded? Display entry['jpegPhoto'][0] directly

Re: Any example to display jpegPhoto?

2009-06-05 Thread Zhang Huangbin
Michael Ströder wrote: > Zhang Huangbin wrote: > >> Is there ny example to display jpegPhoto stored in LDAP as base64 format? >> > > Not sure what you really want to display and where. > > How about entry['jpegPhoto'][0].encode('base64') ?

Any example to display jpegPhoto?

2009-06-05 Thread Zhang Huangbin
Hi, list. Is there ny example to display jpegPhoto stored in LDAP as base64 format? I only found example to add jpegPhoto in python-ldap-2.3.8/Demo/simple.py. Thanks very much. :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian, Ubuntu

Re: Any example of Server/Client Side Sorting?

2009-05-15 Thread Zhang Huangbin
Michael Ströder wrote: > mycmp=lambda x,y: cmp(x[0].lower(), y[0].lower()) > alist.sort(mycmp) I found this and solved too. Big thanks :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian: http://code.google.com/p/ir

Re: Any example of Server/Client Side Sorting?

2009-05-15 Thread Zhang Huangbin
.lower(), y[0].lower()) >>> alist.sort(cmp) Traceback (most recent call last): File "", line 1, in ? File "", line 1, in File "", line 1, in File "", line 1, in File "", line 1, in

Re: Any example of Server/Client Side Sorting?

2009-05-14 Thread Zhang Huangbin
he result contains less than 10 records. -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian: http://code.google.com/p/iredmail/ -- Crystal Reports - New Free Runtime and

Re: Any example of Server/Client Side Sorting?

2009-05-14 Thread Zhang Huangbin
; http://docs.python.org/library/stdtypes.html#index-591 > No idea yet. Any example? Thanks :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian: http://code.google.com/p/iredmail/ ---

Re: Any example of Server/Client Side Sorting?

2009-05-14 Thread Zhang Huangbin
Michael Ströder wrote: > Zhang Huangbin wrote: > >> Any exist python module/function to sort ldap search results? > > Well, why do you really need that? I don't have client-side sorting in > web2ldap because it won't scale with large search results. Some of my

Re: Any example of Server/Client Side Sorting?

2009-05-14 Thread Zhang Huangbin
descriptions of the meaning > which are displayed when displaying the rootDSE. I found it moment ago. :) Tring to learn ldap programing from web2ldap now. Thanks for your great program. :) -- Best regards. Zhang Huangbin - Open Source Mail Serv

Re: Any example of Server/Client Side Sorting?

2009-05-14 Thread Zhang Huangbin
ther you want reverse order > (optional). You could try to generate the controlValue with module pyasn1. Got it. Thanks Michael :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian: http://co

Any example of Server/Client Side Sorting?

2009-05-14 Thread Zhang Huangbin
{'info': '', 'desc': 'Not Supported'} My os is Ubuntu 9.04, OpenLDAP-2.4.15-1ubuntu3. -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL, CentOS, Debian: http://code.google.com/p/iredmail/ -

Re: ANN: python-ldap-2.3.8

2009-04-30 Thread Zhang Huangbin
Michael Ströder wrote: > Find a new release of python-ldap: > > http://www.python-ldap.org/ > Thanks for your great work, Michael. ^_^ -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.co

Re: Limited the usage of SF services for python-ldap

2009-04-09 Thread Zhang Huangbin
dap's SF project entry which > were not used anyway and only spammed ("News" and "Documentation"). > > More news on that to come. > > Ciao, Michael. Try google code project hosting? http://code.google.com/ -- Be

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-17 Thread Zhang Huangbin
Michael Ströder wrote: > Aargh! My fault. Thanks David. > Modules/ldapcontrol.c in CVS HEAD should work now. Tested and it *WORKS* now, Thanks David & Michael. :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Zhang Huangbin
t;, line 81, in decodeControlValue size,cookie = _ldap.decode_page_control(encodedValue) ldap.NO_MEMORY But i don't have a public RHEL 5.3 x86_64 server. :( -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/iredmail/

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Zhang Huangbin
n', 'mailUser', 'top'], 'userPassword': ['{MD5}yB5yjZ1ML2NvBn+JzBSGLA=='], 'accountStatus': ['active'], 'sn': ['2'], 'homeDirectory': ['/home/vmail'], &#

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Zhang Huangbin
ctl_value_len; > > if (!(ber = ber_init(&ldctl_value))) { > LDAPerr(LDAP_NO_MEMORY); > > > So great, it works now. Big thanks, Michael. :) -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://code.google.com/p/ire

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Zhang Huangbin
Michael Ströder wrote: > Thanks to Zhang Huangbin for giving me access to his machine for testing. > So I could track it down. It seems to work with the patch below which I > committed to CVS HEAD. Hi, Michael. Thanks for your quick response and hard work :) But i got new error (ldap.

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Zhang Huangbin
uld be in decode_rfc2696() (which is not yet reached if > encode_rfc2696() fails): > > unsigned long count; I asked friend and he suggests me change them to: unsigned long size; => unsigned int size; unsigned long count; => unsigned int count; Re-compile and install, but it raises th

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Zhang Huangbin
ot;, line 45, in getEncodedTuple return (self.controlType,self.criticality,self.encodeControlValue(self.controlValue)) File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 78, in encodeControlValue return _ldap.encode_page_control(

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-16 Thread Zhang Huangbin
alue(self.controlValue)) File "/usr/lib64/python2.4/site-packages/ldap/controls.py", line 78, in encodeControlValue return _ldap.encode_page_control(size,cookie) ldap.ENCODING_ERROR ldap_free_connection 1 1 ldap_send

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-15 Thread Zhang Huangbin
Zhang Huangbin wrote: > Strange, the same code (Demo/page_control.py) works in: > > - OS: CentOS 5.2, *i386* > - Python: 2.4.3-21.el5 (shipped within CentOS) > - python-ldap: 2.3.6 (installed from source tarball) > - OpenLDAP: 2.3.27-8.el5_2.4 > How can i help developers

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-15 Thread Zhang Huangbin
Strange, the same code (Demo/page_control.py) works in: - OS: CentOS 5.2, *i386* - Python: 2.4.3-21.el5 (shipped within CentOS) - python-ldap: 2.3.6 (installed from source tarball) - OpenLDAP: 2.3.27-8.el5_2.4 -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL

Re: ldap.ENCODING_ERROR when trying to use SimplePageResultsControl

2009-03-15 Thread Zhang Huangbin
dap.ENCODING_ERROR My env: OS: RHEL 5.3, x86_64 Python: 2.4.3-24.el5 (shipped within RHEL 5.3) python-ldap: 2.3.6 (installed from source tarball) OpenLDAP: 2.3.43-3.el5 (shipped within RHEL 5.3) How can i solve it? -- Best regards. Zhang Huangbin - Open Source Mail Server Solut

Re: change password for user

2009-03-09 Thread Zhang Huangbin
el. > > Thanks Michael. :) How can i set DEFAULT password-hash in slapd.conf? such as MD5 or whatever. -- Best regards. Zhang Huangbin - Open Source Mail Server Solution for RHEL/CentOS 5.x: http://co

Re: change password for user

2009-03-08 Thread Zhang Huangbin
that when I don't know the plaintext >> 'oldpw' ? >> > > Simply use None for oldpw. How can i specfy hash mechanism in passwd_s()? like SSHA, MD5. It seems use default setting of ldap server (password-hash in openldap slapd.conf), right? -- Best regards.