From 50c1bc4b29a4a931feaa05fd3b7d4d3b085de207 Mon Sep 17 00:00:00 2001 From: Kendar Date: Fri, 28 May 2021 12:00:19 +0200 Subject: [PATCH] Update --- webvirtcloud/ldapbackend.py | 14 +++++++------- webvirtcloud/settings.py.template | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/webvirtcloud/ldapbackend.py b/webvirtcloud/ldapbackend.py index 3c635ef..5bce462 100644 --- a/webvirtcloud/ldapbackend.py +++ b/webvirtcloud/ldapbackend.py @@ -31,21 +31,21 @@ class LdapAuthenticationBackend(ModelBackend): return connection.response[0] except: - print('get_LDAP_user-error') + print('get_LDAP_user-error') return None def authenticate(self, request, username=None, password=None, **kwargs): - print("authenticate") + print("authenticate") # Get the user information from the LDAP if he can be authenticated isAdmin = False isStaff = False if self.get_LDAP_user(username, password, settings.LDAP_SEARCH_GROUP_FILTER_ADMINS) is None: - print("authenticate-not admin") + print("authenticate-not admin") if self.get_LDAP_user(username, password, settings.LDAP_SEARCH_GROUP_FILTER_STAFF) is None: - print("authenticate-not staff") + print("authenticate-not staff") if self.get_LDAP_user(username, password, settings.LDAP_SEARCH_GROUP_FILTER_USERS) is None: - print("authenticate-not user") + print("authenticate-not user") return None else: print("authenticate-user") @@ -80,9 +80,9 @@ class LdapAuthenticationBackend(ModelBackend): return user def get_user(self, user_id): - print("get_user") + print("get_user") try: return User.objects.get(pk=user_id) except User.DoesNotExist: - print("get_user-user not found") + print("get_user-user not found") return None \ No newline at end of file diff --git a/webvirtcloud/settings.py.template b/webvirtcloud/settings.py.template index 5c0463b..cd7da55 100644 --- a/webvirtcloud/settings.py.template +++ b/webvirtcloud/settings.py.template @@ -95,7 +95,7 @@ DATABASES = { AUTHENTICATION_BACKENDS = [ "django.contrib.auth.backends.ModelBackend", - "ldapbackend.LdapAuthenticationBackend" + "webvirtcloud.ldapbackend.LdapAuthenticationBackend" ] LOGIN_URL = "/accounts/login/"