diff --git a/api/views.py b/api/views.py index c28762685..e044df5d5 100644 --- a/api/views.py +++ b/api/views.py @@ -622,8 +622,10 @@ def changeAdminPassword(request): json_data = json.dumps(data_ret) return HttpResponse(json_data) os.remove(randomFile) + token = hashPassword.generateToken('admin', adminPass) admin = Administrator.objects.get(userName="admin") admin.password = hashPassword.hash_password(adminPass) + admin.token = token admin.save() data_ret = {"changed": 1, 'error_message': "None"} diff --git a/dockerManager/container.py b/dockerManager/container.py index f4c0adc1c..56691bfc4 100644 --- a/dockerManager/container.py +++ b/dockerManager/container.py @@ -1029,7 +1029,7 @@ class ContainerManager(multi.Thread): con.env = json.dumps(envDict) con.volumes = json.dumps(volumes) - con.save() + con.save() data_ret = {'saveSettingsStatus': 1, 'error_message': 'None'} json_data = json.dumps(data_ret) diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index 0d462f756..4712348b2 100644 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -40,18 +40,21 @@ class FileManager: counter = 0 for items in output: - currentFile = items.split(' ') - currentFile = filter(lambda a: a != '', currentFile) - if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total': - continue - dirCheck = 0 - if currentFile[0][0] == 'd': - dirCheck = 1 + try: + currentFile = items.split(' ') + currentFile = filter(lambda a: a != '', currentFile) + if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total': + continue + dirCheck = 0 + if currentFile[0][0] == 'd': + dirCheck = 1 - size = str(int(int(currentFile[4])/float(1024))) - lastModified = currentFile[5] + ' ' + currentFile[6] + ' ' + currentFile[7] - finalData[str(counter)] = [currentFile[-1], currentFile[-1], lastModified, size, currentFile[0], dirCheck] - counter = counter + 1 + size = str(int(int(currentFile[4])/float(1024))) + lastModified = currentFile[5] + ' ' + currentFile[6] + ' ' + currentFile[7] + finalData[str(counter)] = [currentFile[-1], currentFile[-1], lastModified, size, currentFile[0], dirCheck] + counter = counter + 1 + except: + continue json_data = json.dumps(finalData) return HttpResponse(json_data) @@ -69,19 +72,22 @@ class FileManager: counter = 0 for items in output: - currentFile = items.split(' ') - currentFile = filter(lambda a: a != '', currentFile) + try: + currentFile = items.split(' ') + currentFile = filter(lambda a: a != '', currentFile) - if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total': + if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total': + continue + + dirCheck = False + if currentFile[0][0] == 'd': + dirCheck = True + + finalData[str(counter)] = [currentFile[-1], self.data['completeStartingPath'] + '/' + currentFile[-1], dirCheck] + counter = counter + 1 + except: continue - dirCheck = False - if currentFile[0][0] == 'd': - dirCheck = True - - finalData[str(counter)] = [currentFile[-1], self.data['completeStartingPath'] + '/' + currentFile[-1], dirCheck] - counter = counter + 1 - json_data = json.dumps(finalData) return HttpResponse(json_data) diff --git a/install/install.py b/install/install.py index 6c4ed0d34..2dd6f0096 100644 --- a/install/install.py +++ b/install/install.py @@ -780,7 +780,7 @@ class preFlightsChecks: os.chdir(self.path) - command = "wget http://cyberpanel.sh/CyberPanel.1.8.0.tar.gz" + command = "wget http://cyberpanel.sh/CyberPanel.1.8.1.tar.gz" #command = "wget http://cyberpanel.sh/CyberPanelTemp.tar.gz" preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]', 'CyberPanel Download', @@ -789,7 +789,7 @@ class preFlightsChecks: ## count = 0 - command = "tar zxf CyberPanel.1.8.0.tar.gz" + command = "tar zxf CyberPanel.1.8.1.tar.gz" #command = "tar zxf CyberPanelTemp.tar.gz" preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]', 'Extract CyberPanel',1, 1, os.EX_OSERR) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 25cddfcb3..657f3bd84 100644 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -848,6 +848,11 @@ WantedBy=multi-user.target""" if items.find('containerization') > -1: containerization = 0 + manageServices = 1 + for items in data: + if items.find('manageServices') > -1: + manageServices = 0 + Upgrade.stdOut('Restoring settings file!') @@ -871,6 +876,9 @@ WantedBy=multi-user.target""" if containerization == 1: writeToFile.writelines(" 'containerization',\n") + if manageServices == 1: + writeToFile.writelines(" 'manageServices',\n") + else: writeToFile.writelines(items) diff --git a/s3Backups/s3Backups.py b/s3Backups/s3Backups.py index 37f4fd830..c83f2bc7b 100644 --- a/s3Backups/s3Backups.py +++ b/s3Backups/s3Backups.py @@ -96,7 +96,7 @@ class S3Backups(multi.Thread): tempPath = '/home/cyberpanel/' + str(randint(10000, 99999)) writeToFile = open(tempPath, 'w') - writeToFile.write('* * * * * /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/s3Backups/s3Backups.py > /home/cyberpanel/error-logs.txt 2>&1\n') + writeToFile.write('0 0 * * * /usr/local/CyberCP/bin/python2 /usr/local/CyberCP/s3Backups/s3Backups.py > /home/cyberpanel/error-logs.txt 2>&1\n') writeToFile.close() command = 'sudo crontab -u cyberpanel ' + tempPath diff --git a/static/dockerManager/dockerManager.js b/static/dockerManager/dockerManager.js index a89bcf670..728de63d9 100644 --- a/static/dockerManager/dockerManager.js +++ b/static/dockerManager/dockerManager.js @@ -569,12 +569,12 @@ app.controller('viewContainer', function ($scope, $http) { $('#actionLoading').hide(); } }) - } + }; $scope.addEnvField = function () { var countEnv = Object.keys($scope.envList).length; $scope.envList[countEnv + 1] = {'name': '', 'value': ''}; - } + }; $scope.showTop = function () { $scope.topHead = []; @@ -615,7 +615,7 @@ app.controller('viewContainer', function ($scope, $http) { $scope.loadingTop = false; } - } + }; $scope.cRemove = function () { (new PNotify({ @@ -672,7 +672,7 @@ app.controller('viewContainer', function ($scope, $http) { $('#actionLoading').hide(); } }) - } + }; $scope.refreshStatus = function () { url = "/docker/getContainerStatus"; @@ -784,7 +784,7 @@ app.controller('viewContainer', function ($scope, $http) { $scope.rPolicy = "No"; } - } + }; $scope.cAction = function (action) { $('#actionLoading').show(); @@ -831,7 +831,7 @@ app.controller('viewContainer', function ($scope, $http) { $('#actionLoading').hide(); } - } + }; $scope.loadLogs = function (name) { $scope.logs = "Loading..."; @@ -865,7 +865,7 @@ app.controller('viewContainer', function ($scope, $http) { console.log("not good"); $scope.logs = "Error loading log"; } - } + }; }); diff --git a/userManagment/templates/userManagment/changeUserACL.html b/userManagment/templates/userManagment/changeUserACL.html index e0257a53a..cf1608812 100644 --- a/userManagment/templates/userManagment/changeUserACL.html +++ b/userManagment/templates/userManagment/changeUserACL.html @@ -16,7 +16,7 @@
+ {% trans "Change User ACL" %}