diff --git a/cli/cyberPanel.py b/cli/cyberPanel.py index 1d92f5042..8b0c58018 100755 --- a/cli/cyberPanel.py +++ b/cli/cyberPanel.py @@ -1282,6 +1282,37 @@ def main(): cyberpanel.issueSelfSignedSSL(args.domainName) + elif args.function == 'utility': + if not os.path.exists('/usr/bin/cyberpanel_utility'): + command = 'wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh' + ProcessUtilities.executioner(command) + + command = 'chmod 700 /usr/bin/cyberpanel_utility' + ProcessUtilities.executioner(command) + + command = '/usr/bin/cyberpanel_utility' + ProcessUtilities.executioner(command) + elif args.function == 'upgrade' or args.function == 'update': + if not os.path.exists('/usr/bin/cyberpanel_utility'): + command = 'wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh' + ProcessUtilities.executioner(command) + + command = 'chmod 700 /usr/bin/cyberpanel_utility' + ProcessUtilities.executioner(command) + + command = '/usr/bin/cyberpanel_utility --upgrade' + ProcessUtilities.executioner(command) + elif args.function == 'help': + if not os.path.exists('/usr/bin/cyberpanel_utility'): + command = 'wget -q -O /usr/bin/cyberpanel_utility https://cyberpanel.sh/misc/cyberpanel_utility.sh' + ProcessUtilities.executioner(command) + + command = 'chmod 700 /usr/bin/cyberpanel_utility' + ProcessUtilities.executioner(command) + + command = '/usr/bin/cyberpanel_utility --help' + ProcessUtilities.executioner(command) + if __name__ == "__main__": diff --git a/filemanager/filemanager.py b/filemanager/filemanager.py index 643dbead5..4ded5fb57 100755 --- a/filemanager/filemanager.py +++ b/filemanager/filemanager.py @@ -44,7 +44,9 @@ class FileManager: domainName = self.data['domainName'] website = Websites.objects.get(domain=domainName) - if not self.data['completeStartingPath'].find(self.data['home']) > -1: + pathCheck = '/home/%s' % (domainName) + + if self.data['completeStartingPath'].find(pathCheck) == -1: return self.ajaxPre(0, 'Not allowed to browse this path, going back home!') command = "ls -la --group-directories-first " + self.returnPathEnclosed( @@ -332,8 +334,9 @@ class FileManager: fs = FileSystemStorage() filename = fs.save(myfile.name, myfile) finalData['fileName'] = fs.url(filename) + pathCheck = '/home/%s' % (self.data['domainName']) - if not self.data['completePath'].find(self.data['home']) > -1: + if self.data['completePath'].find(pathCheck) == -1: return self.ajaxPre(0, 'Not allowed to move in this path, please choose location inside home!') command = 'mv ' + self.returnPathEnclosed('/home/cyberpanel/media/' + myfile.name) + ' ' + self.returnPathEnclosed(self.data['completePath'] + '/' + myfile.name) diff --git a/install/lscp.tar.gz b/install/lscp.tar.gz index 374600cd0..c9181d2de 100644 Binary files a/install/lscp.tar.gz and b/install/lscp.tar.gz differ diff --git a/plogical/acl.py b/plogical/acl.py index 51db810b5..0e4724f23 100755 --- a/plogical/acl.py +++ b/plogical/acl.py @@ -444,22 +444,22 @@ class ACLManager: domainsList = [] if currentACL['admin'] == 1: - domains = Domains.objects.all() + domains = Websites.objects.all() for items in domains: - domainsList.append(items.name) + domainsList.append(items.domain) else: admin = Administrator.objects.get(pk=userID) - domains = admin.domains_set.all() + domains = admin.websites_set.all() for items in domains: - domainsList.append(items.name) + domainsList.append(items.domain) admins = Administrator.objects.filter(owner=admin.pk) for items in admins: - doms = items.domains_set.all() + doms = items.websites_set.all() for dom in doms: - domainsList.append(dom.name) + domainsList.append(dom.domain) return domainsList diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 80facc113..9c28e1d8b 100755 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -22,15 +22,17 @@ class backupScheduleLocal: localBackupPath = '/home/cyberpanel/localBackupPath' now = datetime.now() + @staticmethod def prepare(): try: - backupLogPath = "/usr/local/lscp/logs/local_backup_log." + time.strftime("%m.%d.%Y_%H-%M-%S") + backupRunTime = time.strftime("%m.%d.%Y_%H-%M-%S") + backupLogPath = "/usr/local/lscp/logs/local_backup_log." + backupRunTime writeToFile = open(backupLogPath, "a") backupSchedule.remoteBackupLogging(backupLogPath, "#################################################") - backupSchedule.remoteBackupLogging(backupLogPath," Local Backup log for: " + time.strftime("%m.%d.%Y_%H-%M-%S")) + backupSchedule.remoteBackupLogging(backupLogPath," Local Backup log for: " + backupRunTime) backupSchedule.remoteBackupLogging(backupLogPath, "#################################################\n") backupSchedule.remoteBackupLogging(backupLogPath, "") @@ -43,7 +45,7 @@ class backupScheduleLocal: if os.path.exists(backupScheduleLocal.localBackupPath): backupPath = retValues[1] + ".tar.gz" - localBackupPath = '%s/%s' % (open(backupScheduleLocal.localBackupPath, 'r').read().rstrip('/'), time.strftime("%b-%d-%Y")) + localBackupPath = '%s/%s' % (open(backupScheduleLocal.localBackupPath, 'r').read().rstrip('/'), backupRunTime) command = 'mkdir -p %s' % (localBackupPath) ProcessUtilities.normalExecutioner(command) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index a6eaf4355..4be6b65c5 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1665,7 +1665,6 @@ CSRF_COOKIE_SECURE = True command = "find /usr/local/CyberCP/ -name '*.pyc' -delete" Upgrade.executioner(command, 0) - Upgrade.stdOut("Permissions updated.") except BaseException as msg: diff --git a/static/filemanager/js/fileManager.js b/static/filemanager/js/fileManager.js index 067739616..725224dbb 100644 --- a/static/filemanager/js/fileManager.js +++ b/static/filemanager/js/fileManager.js @@ -14,7 +14,6 @@ function getCookie(name) { return cookieValue; } - var fileManager = angular.module('fileManager', ['angularFileUpload']); fileManager.config(['$interpolateProvider', function ($interpolateProvider) { @@ -1483,8 +1482,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader, url = "/filemanager/downloadFile"; var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0]; - var indexPublicHTML = downloadURL.indexOf("public_html") + 11; - $window.location.href = '/preview/' + domainName + downloadURL.slice(indexPublicHTML); + window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL; }; diff --git a/userManagment/views.py b/userManagment/views.py index a43049599..51000a186 100755 --- a/userManagment/views.py +++ b/userManagment/views.py @@ -139,7 +139,10 @@ def submitUserCreation(request): password = data['password'] websitesLimit = data['websitesLimit'] selectedACL = data['selectedACL'] - securityLevel = data['securityLevel'] + try: + securityLevel = data['securityLevel'] + except: + securityLevel = 'HIGH' selectedACL = ACL.objects.get(name=selectedACL) @@ -313,7 +316,10 @@ def saveModifications(request): firstName = data['firstName'] lastName = data['lastName'] email = data['email'] - securityLevel = data['securityLevel'] + try: + securityLevel = data['securityLevel'] + except: + securityLevel = 'HIGH' user = Administrator.objects.get(userName=accountUsername)