Skip to content

Commit

Permalink
vchange
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 26, 2024
1 parent 74d3ba1 commit a95c9d0
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion databases/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,13 @@ def getMysqlstatus(request):
userID = request.session['userID']
finalData = mysqlUtilities.showStatus()

currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

finalData = json.dumps(finalData)
return HttpResponse(finalData)

Expand All @@ -386,6 +393,12 @@ def restartMySQL(request):
try:
userID = request.session['userID']
finalData = mysqlUtilities.restartMySQL()
currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

data = {}

Expand All @@ -402,6 +415,13 @@ def generateRecommendations(request):
try:
userID = request.session['userID']

currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

data = json.loads(request.body)
detectedRam = data['detectedRam']

Expand All @@ -418,9 +438,17 @@ def generateRecommendations(request):

def applyMySQLChanges(request):
try:

userID = request.session['userID']

currentACL = ACLManager.loadedACL(userID)

if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('FilemanagerAdmin', 0)

data = json.loads(request.body)
logging.writeToFile("=-------------------------------------------")
finalData = mysqlUtilities.applyMySQLChanges(data)

data = {}
Expand Down

0 comments on commit a95c9d0

Please sign in to comment.