From a28b599f893057aca96270fd138bd1042f8d4a8c Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 23 Feb 2011 16:47:12 +0000 Subject: finish the move to django_application common class --- modules/django_application/files/custom_backend.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 modules/django_application/files/custom_backend.py (limited to 'modules/django_application/files') diff --git a/modules/django_application/files/custom_backend.py b/modules/django_application/files/custom_backend.py new file mode 100644 index 00000000..828744fb --- /dev/null +++ b/modules/django_application/files/custom_backend.py @@ -0,0 +1,9 @@ + +from django_auth_ldap.backend import LDAPBackend,_LDAPUser + +class ForceUidLDAPBackend(LDAPBackend): + def ldap_to_django_username(self, username): + # force uid if someone give a email + return _LDAPUser(self, username=username).attrs['uid'][0] + + -- cgit v1.2.1