Skip to content

Commit d83c5a9

Browse files
committed
bug fix: email list function
1 parent 9fbdc60 commit d83c5a9

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

CyberCP/secMiddleware.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def __call__(self, request):
3939
or pathActual.endswith('/webhook') or pathActual.startswith('/cloudAPI') or pathActual.endswith('/gitNotify'):
4040
pass
4141
else:
42+
if os.path.exists(ProcessUtilities.debugPath):
43+
logging.writeToFile(f'Request needs session : {pathActual}')
4244
try:
4345
val = request.session['userID']
4446
except:
@@ -95,6 +97,9 @@ def __call__(self, request):
9597
if bool(request.body):
9698
try:
9799

100+
if os.path.exists(ProcessUtilities.debugPath):
101+
logging.writeToFile('Request body detected.. scanning')
102+
98103
# logging.writeToFile(request.body)
99104
data = json.loads(request.body)
100105
for key, value in data.items():

api/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def verifyConn(request):
4848
data_ret = {"verifyConn": 0}
4949
json_data = json.dumps(data_ret)
5050
return HttpResponse(json_data)
51-
5251
except BaseException as msg:
5352
data_ret = {'verifyConn': 0, 'error_message': str(msg)}
5453
json_data = json.dumps(data_ret)

backup/views.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from loginSystem.views import loadLoginPage
1212
import os
1313
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
14-
from django.shortcuts import HttpResponse
1514
from django.views.decorators.csrf import csrf_exempt
1615

1716
def loadBackupHome(request):

cloudAPI/views.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ def router(request):
2424
if admin.api == 0:
2525
return cm.ajaxPre(0, 'API Access Disabled.')
2626

27-
if cm.verifyLogin(request)[0] == 1:
28-
pass
29-
else:
30-
return cm.verifyLogin(request)[1]
27+
try:
28+
if cm.verifyLogin(request)[0] == 1:
29+
pass
30+
else:
31+
return cm.verifyLogin(request)[1]
32+
except BaseException as msg:
33+
return cm.ajaxPre(0, f"Something went wrong during token processing. ErrorL {str(msg)}")
3134

3235

3336
## Debug Log

mailServer/mailserverManager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,8 @@ def fetchEmails(self):
560560

561561
if os.path.exists(postfixMapPath):
562562

563-
postfixMapData = open(postfixMapPath, 'r').read()
563+
postfixMapData = open(postfixMapPath, 'r', encoding='utf-8').read()
564+
564565

565566
if postfixMapData.find(selectedDomain) == -1:
566567
mailConfigured = 0

0 commit comments

Comments
 (0)