From a95c9d08a6e4a50341675eb733d7fc0665680337 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Fri, 26 Jan 2024 11:45:13 +0500 Subject: [PATCH] vchange --- databases/views.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/databases/views.py b/databases/views.py index 241adf44a..cd2dd3221 100755 --- a/databases/views.py +++ b/databases/views.py @@ -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) @@ -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 = {} @@ -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'] @@ -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 = {}