mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
minor filemanager bug fix
This commit is contained in:
@@ -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"}
|
||||
|
||||
@@ -40,6 +40,7 @@ class FileManager:
|
||||
|
||||
counter = 0
|
||||
for items in output:
|
||||
try:
|
||||
currentFile = items.split(' ')
|
||||
currentFile = filter(lambda a: a != '', currentFile)
|
||||
if currentFile[-1] == '.' or currentFile[-1] == '..' or currentFile[0] == 'total':
|
||||
@@ -52,6 +53,8 @@ class FileManager:
|
||||
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,6 +72,7 @@ class FileManager:
|
||||
|
||||
counter = 0
|
||||
for items in output:
|
||||
try:
|
||||
currentFile = items.split(' ')
|
||||
currentFile = filter(lambda a: a != '', currentFile)
|
||||
|
||||
@@ -81,6 +85,8 @@ class FileManager:
|
||||
|
||||
finalData[str(counter)] = [currentFile[-1], self.data['completeStartingPath'] + '/' + currentFile[-1], dirCheck]
|
||||
counter = counter + 1
|
||||
except:
|
||||
continue
|
||||
|
||||
json_data = json.dumps(finalData)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div ng-controller="changeUserACLCTRL" class="panel">
|
||||
<div class="panel-body">
|
||||
<h3 class="content-box-header">
|
||||
{% trans "Delete Website" %} <img ng-hide="aclLoading" src="{% static 'images/loading.gif' %}">
|
||||
{% trans "Change User ACL" %} <img ng-hide="aclLoading" src="{% static 'images/loading.gif' %}">
|
||||
</h3>
|
||||
<div class="example-box-wrapper">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user