Unless your an LDAP expert it’s not obvious how to find the groups a user is a member of, and that also describes how you need to tackle this problem.
This code makes a lot of assumptions and also assumes that a user’s UID is named ‘uid’.
If there’s a better way to do this, let me know.
References:
This thread on the Python-LDAP mailing list was quite useful:
- http://sourceforge.net/p/python-ldap/mailman/message/19636166/
- Photo is one I took in 2007 at Fort Point in Boston.