mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 15:53:28 +00:00
[password session] Disable for non-database users
This commit is contained in:
@@ -8,5 +8,9 @@ class CheckPasswordHash(object):
|
||||
"""Logout user if value of hash key in session is not equal to current password hash"""
|
||||
def process_view(self, request, *args, **kwargs):
|
||||
if getattr(request.user, 'is_authenticated') and request.user.is_authenticated():
|
||||
if request.user.enc_password == '!':
|
||||
# Disable for LDAP/Shibboleth/SAML/... users.
|
||||
return None
|
||||
|
||||
if request.session.get(PASSWORD_HASH_KEY) != get_password_hash(request.user):
|
||||
logout(request)
|
Reference in New Issue
Block a user