From dcf3b9bc09d4516082deae547a337c7dac9f70a1 Mon Sep 17 00:00:00 2001 From: usmannasir <usman@cyberpersons.com> Date: Thu, 31 Oct 2024 07:48:51 +0400 Subject: [PATCH] release v2.3.8 --- CyberCP/secMiddleware.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CyberCP/secMiddleware.py b/CyberCP/secMiddleware.py index b6dad1d50..e491035f3 100755 --- a/CyberCP/secMiddleware.py +++ b/CyberCP/secMiddleware.py @@ -25,7 +25,7 @@ def __call__(self, request): try: uID = request.session['userID'] admin = Administrator.objects.get(pk=uID) - ipAddr = get_client_ip(request) + ipAddr = secMiddleware.get_client_ip(request) if ipAddr.find('.') > -1: if request.session['ipAddr'] == ipAddr or admin.securityLevel == secMiddleware.LOW: @@ -33,19 +33,19 @@ def __call__(self, request): else: del request.session['userID'] del request.session['ipAddr'] - logging.writeToFile(get_client_ip(request)) + logging.writeToFile(secMiddleware.get_client_ip(request)) final_dic = {'error_message': "Session reuse detected, IPAddress logged.", "errorMessage": "Session reuse detected, IPAddress logged."} final_json = json.dumps(final_dic) return HttpResponse(final_json) else: - ipAddr = get_client_ip(request).split(':')[:3] + ipAddr = secMiddleware.get_client_ip(request).split(':')[:3] if request.session['ipAddr'] == ipAddr or admin.securityLevel == secMiddleware.LOW: pass else: del request.session['userID'] del request.session['ipAddr'] - logging.writeToFile(get_client_ip(request)) + logging.writeToFile(secMiddleware.get_client_ip(request)) final_dic = {'error_message': "Session reuse detected, IPAddress logged.", "errorMessage": "Session reuse detected, IPAddress logged."} final_json = json.dumps(final_dic)