1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00
This commit is contained in:
Kendar 2021-05-28 12:37:34 +02:00
parent 5ff7a73335
commit 306c4db3cd
2 changed files with 7 additions and 2 deletions

View file

@ -35,7 +35,9 @@ class LdapAuthenticationBackend(ModelBackend):
return None
def authenticate(self, request, username=None, password=None, **kwargs):
print("authenticate")
if not settings.LDAP_ENABLED:
return None
print("authenticate_ldap")
# Get the user information from the LDAP if he can be authenticated
isAdmin = False
isStaff = False
@ -97,7 +99,9 @@ class LdapAuthenticationBackend(ModelBackend):
return user
def get_user(self, user_id):
print("get_user")
if not settings.LDAP_ENABLED:
return None
print("get_user_ldap")
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:

View file

@ -214,6 +214,7 @@ OTP_ENABLED = False
LOGIN_REQUIRED_IGNORE_VIEW_NAMES = ["accounts:email_otp"]
LDAP_ENABLED = False
LDAP_URL = '192.168.1.67'
LDAP_PORT = 389
USE_SSL = False