dastergon/identity.gentoo.org — pull request #1 by mgorny (2013-08-13 22:15:07+00:00)
Title: Secondary password: bind_as() and unknown hashes

1. `LDAPUser.bind_as()` to temporarily bind LDAP to another user, like this:

with LDAPUser.objects.get(username='foo').bind_as('foo', 'mypass') as u:
someldapops()

And after leaving the `with` scope, connection is back to the previous owner.

2. Graceful handling for unknown password hashes. We shouldn't really optimistically assume all hashes will be crypt/md5. Just ignore unknown hashes.