[auth] ldap backup, implement CAS_LDAP_ATTRS_VIEW set to 0
This commit is contained in:
parent
85426ded17
commit
f0f4ec0bdc
1 changed files with 6 additions and 5 deletions
|
@ -391,12 +391,13 @@ class LdapAuthUser(DBAuthUser): # pragma: no cover
|
|||
or :class:`list` of :func:`unicode`. If the user do not exists, the returned
|
||||
:class:`dict` is empty.
|
||||
:rtype: dict
|
||||
:raises NotImplementedError: if the password check method in `CAS_LDAP_PASSWORD_CHECK`
|
||||
do not allow to fetch the attributes without the user credentials.
|
||||
"""
|
||||
if settings.CAS_LDAP_PASSWORD_CHECK == "bind" and settings.CAS_LDAP_ATTRS_VIEW == 1:
|
||||
if settings.CAS_LDAP_PASSWORD_CHECK == "bind":
|
||||
if settings.CAS_LDAP_ATTRS_VIEW == 1:
|
||||
user = UserAttributes.objects.get(username=self.username)
|
||||
return user.attributs
|
||||
else:
|
||||
return self.user
|
||||
else:
|
||||
return super(LdapAuthUser, self).attributs()
|
||||
|
||||
|
|
Loading…
Reference in a new issue