Skip to content

Commit

Permalink
bug fix: email list function
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Nov 1, 2024
1 parent 9fbdc60 commit d83c5a9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CyberCP/secMiddleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def __call__(self, request):
or pathActual.endswith('/webhook') or pathActual.startswith('/cloudAPI') or pathActual.endswith('/gitNotify'):
pass
else:
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(f'Request needs session : {pathActual}')
try:
val = request.session['userID']
except:
Expand Down Expand Up @@ -95,6 +97,9 @@ def __call__(self, request):
if bool(request.body):
try:

if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile('Request body detected.. scanning')

# logging.writeToFile(request.body)
data = json.loads(request.body)
for key, value in data.items():
Expand Down
1 change: 0 additions & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def verifyConn(request):
data_ret = {"verifyConn": 0}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)

except BaseException as msg:
data_ret = {'verifyConn': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
Expand Down
1 change: 0 additions & 1 deletion backup/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from loginSystem.views import loadLoginPage
import os
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
from django.shortcuts import HttpResponse
from django.views.decorators.csrf import csrf_exempt

def loadBackupHome(request):
Expand Down
11 changes: 7 additions & 4 deletions cloudAPI/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ def router(request):
if admin.api == 0:
return cm.ajaxPre(0, 'API Access Disabled.')

if cm.verifyLogin(request)[0] == 1:
pass
else:
return cm.verifyLogin(request)[1]
try:
if cm.verifyLogin(request)[0] == 1:
pass
else:
return cm.verifyLogin(request)[1]
except BaseException as msg:
return cm.ajaxPre(0, f"Something went wrong during token processing. ErrorL {str(msg)}")


## Debug Log
Expand Down
3 changes: 2 additions & 1 deletion mailServer/mailserverManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ def fetchEmails(self):

if os.path.exists(postfixMapPath):

postfixMapData = open(postfixMapPath, 'r').read()
postfixMapData = open(postfixMapPath, 'r', encoding='utf-8').read()


if postfixMapData.find(selectedDomain) == -1:
mailConfigured = 0
Expand Down

0 comments on commit d83c5a9

Please sign in to comment.