[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
|
or :class:`list` of :func:`unicode`. If the user do not exists, the returned
|
||||||
:class:`dict` is empty.
|
:class:`dict` is empty.
|
||||||
:rtype: dict
|
: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":
|
||||||
user = UserAttributes.objects.get(username=self.username)
|
if settings.CAS_LDAP_ATTRS_VIEW == 1:
|
||||||
return user.attributs
|
user = UserAttributes.objects.get(username=self.username)
|
||||||
|
return user.attributs
|
||||||
|
else:
|
||||||
|
return self.user
|
||||||
else:
|
else:
|
||||||
return super(LdapAuthUser, self).attributs()
|
return super(LdapAuthUser, self).attributs()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue