python-ldap and openldap 2.07
jens at digicool.com
Sat May 12 15:44:24 CEST 2001
> Basically I'm writing some code for the Mailman mailing list software, so
> that it can do authentication, subscription, etc by LDAP. Have the
> 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])])
> 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
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.
More information about the python-ldap