From 88b4d20f0ae808c06b86bede1e4cb34bcc497b8b Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 20 Apr 2022 16:31:24 +0500 Subject: [PATCH] bug fix: load main page data --- .../baseTemplate/custom-js/system-status.js | 6 ++--- filemanager/views.py | 23 +++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/baseTemplate/static/baseTemplate/custom-js/system-status.js b/baseTemplate/static/baseTemplate/custom-js/system-status.js index affffe87d..70c8798a3 100644 --- a/baseTemplate/static/baseTemplate/custom-js/system-status.js +++ b/baseTemplate/static/baseTemplate/custom-js/system-status.js @@ -514,9 +514,9 @@ app.controller('homePageStatus', function ($scope, $http, $timeout) { $scope.two = response.data.two; $scope.three = response.data.three; - document.getElementById("load1").innerHTML = $scope.one; - document.getElementById("load2").innerHTML = $scope.two; - document.getElementById("load3").innerHTML = $scope.three; + //document.getElementById("load1").innerHTML = $scope.one; + //document.getElementById("load2").innerHTML = $scope.two; + //document.getElementById("load3").innerHTML = $scope.three; } function cantGetLoadAvgData(response) { diff --git a/filemanager/views.py b/filemanager/views.py index e08b6fe8d..795a5a734 100755 --- a/filemanager/views.py +++ b/filemanager/views.py @@ -104,12 +104,27 @@ def controller(request): admin = Administrator.objects.get(pk=userID) currentACL = ACLManager.loadedACL(userID) - if ACLManager.checkOwnership(domainName, admin, currentACL) == 1: + if domainName == '': + if currentACL['admin'] == 1: + pass + else: + return ACLManager.loadErrorJson('FilemanagerAdmin', 0) + else: + if ACLManager.checkOwnership(domainName, admin, currentACL) == 1: + pass + else: + return ACLManager.loadErrorJson() + except: + method = data['method'] + userID = request.session['userID'] + currentACL = ACLManager.loadedACL(userID) + + if currentACL['admin'] == 1: pass else: - return ACLManager.loadErrorJson() - except: - print("habbi") + return ACLManager.loadErrorJson('FilemanagerAdmin', 0) + + fm = FM(request, data) if method == 'listForTable':