-
-
-
-
Looks good as far as I can tell. In the future, you'll want to keep only one review request for the change and not publish until everything's updated, or discard it when you want to make changes. I know that's not necessarily clear the first time you use it though. Thanks for the patch!
Add LDAPBackend
Review Request #16 — Created May 20, 2007 and submitted
This patch adds an LDAPBackend class to accounts/backends.py, to allow Review Board to get its authentication information from an LDAP server. It requires the python-ldap package. Usage: LDAP_URI = 'ldap://ldap.example.com:389 LDAP_UID_MASK = 'uid=%s,ou=users,dc=example,dc=com' LDAP_ANON_BIND_UID = '' LDAP_ANON_BIND_PASSWD = '' LDAP_EMAIL_DOMAIN = 'example.com' AUTHENTICATION_BACKENDS = ('accounts.backends.LDAPBackend', 'django.contrib.auth.backends.ModelBackend')
It works locally for me; users Review Board hasn't seen before are successfully authenticated against LDAP.
-
Just one change I'd like to see.
-
We can make this a bit more compact. Instead of user = self.get_or_create_user(username) do this: return self.get_or_create_user(username) Then delete the "user = None" and "return user" lines at the beginning and end of the function. If there's no return statement, python will give us None as the result. I've updated the NISBackend to do this. See http://reviewboard.chipx86.com/r/18/