From: Jens V. <je...@di...> - 2001-05-12 13:44:09
|
donal, > Basically I'm writing some code for the Mailman mailing list software, so > that it can do authentication, subscription, etc by LDAP. Have the > authentication > working after some initial playing with the python-ldap module, but I can't > for the life of me modify any values in the ldap directory. i'm ctually very interested in having mailman get auth info from ldap myself. mind sharing your experiences / code? i haven't gotten to even looking at mailman yet, but it will be a requirement for all zope-related mailing lists real soon now. > *I may just be just making errors in my code, but i'm nearly sure i'm not* > the line of code i'm using: > res = l.modify_s(user_dn, [(MOD_REPLACE, 'userPassword', [new_pw])]) > where: > user_dn = cn=huntd2,ou=RedGiant,o=DCU > new_pw = newpw > > is there a way to get the LDAP error codes back from the python-ldap module?? take a look at the manage_editUserPassword method in the LDAPUserManager module here: http://cvs.dataflake.org/LDAPUserManager/LDAPUserManager.py?rev=1.27&content -type=text/vnd.viewcvs-markup the call to modify_s is wrapped in a try/except and if an exception occurs i catch it and feed it to a formatting routine so i can return it back to a web page. the code is pretty zope-specific, but you can see the pattern. jens |