diff options
author | Michael Scherer <misc@mageia.org> | 2011-02-23 16:47:12 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2011-02-23 16:47:12 +0000 |
commit | a28b599f893057aca96270fd138bd1042f8d4a8c (patch) | |
tree | c4445e94afa818252f853096efadf2ff5da2a5b4 /modules/django_application/files | |
parent | d28b4f664c69e97c7615d6aafcf4141b4f63f342 (diff) | |
download | puppet-a28b599f893057aca96270fd138bd1042f8d4a8c.tar puppet-a28b599f893057aca96270fd138bd1042f8d4a8c.tar.gz puppet-a28b599f893057aca96270fd138bd1042f8d4a8c.tar.bz2 puppet-a28b599f893057aca96270fd138bd1042f8d4a8c.tar.xz puppet-a28b599f893057aca96270fd138bd1042f8d4a8c.zip |
finish the move to django_application common class
Diffstat (limited to 'modules/django_application/files')
-rw-r--r-- | modules/django_application/files/custom_backend.py | 9 |
1 files changed, 9 insertions, 0 deletions
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] + + |