diff --git a/filemanager/static/filemanager/js/fileManager.js b/filemanager/static/filemanager/js/fileManager.js index 3579f6501..c52c2d12e 100755 --- a/filemanager/static/filemanager/js/fileManager.js +++ b/filemanager/static/filemanager/js/fileManager.js @@ -5,7 +5,7 @@ fileManager.config(['$interpolateProvider', function($interpolateProvider) { $interpolateProvider.endSymbol('$}'); }]); -fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader) { +fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $window) { $( document.body ).click(function() { rightClickNode.style.display = "none"; @@ -1383,45 +1383,9 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader) { $scope.downloadFile = function() { url = "/filemanager/downloadFile"; - - var data = { - fileToDownload: $scope.currentPath + "/" + allFilesAndFolders[0], - domainRandomSeed:domainRandomSeed, - domainName: domainName - }; - - - $http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas); - - function ListInitialDatas(response) { - - var blob = new Blob([response.data]); - - //IE case - if (!!window.navigator.msSaveBlob){ - window.navigator.msSaveBlob(blob, allFilesAndFolders[0]); - return; - } - - //create blob and url - var url = URL.createObjectURL(blob); - - //create invisible acnhor, to specify the file name - var a = document.createElement('a'); - document.body.appendChild(a); - a.style = "display: none"; - a.href = url; - a.download = allFilesAndFolders[0]; - a.click(); - - setTimeout(function(){ - URL.revokeObjectURL(url); - document.body.removeChild(a); - }, 100); - } - - function cantLoadInitialDatas(response) {} - + var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0]; + var indexPublicHTML = downloadURL.indexOf("public_html") + 11; + $window.location.href = '/preview/' + domainName + downloadURL.slice(indexPublicHTML); }; diff --git a/loginSystem/static/loginSystem/login-systen.js b/loginSystem/static/loginSystem/login-systen.js index 05dfab8cd..30a56f0fe 100644 --- a/loginSystem/static/loginSystem/login-systen.js +++ b/loginSystem/static/loginSystem/login-systen.js @@ -73,9 +73,8 @@ application.controller('loginSystem', function($scope,$http,$window) { function ListInitialData(response) { - console.log(response.data) - if (response.data.loginStatus == 0) + if (response.data.loginStatus === 0) { $scope.errorMessage = response.data.error_message; $("#loginFailed").fadeIn(); @@ -89,9 +88,7 @@ application.controller('loginSystem', function($scope,$http,$window) { $("#verifyingLogin").hide(); } - function cantLoadInitialData(response) { - console.log("not good"); - } + function cantLoadInitialData(response) {} diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index f9e7088e9..332a14a94 100644 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -174,5 +174,9 @@ class backupSchedule: except BaseException,msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [prepare]") +def main(): + backupSchedule.prepare() -backupSchedule.prepare() \ No newline at end of file + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 17b935291..272c91f03 100644 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -37,5 +37,9 @@ class backupScheduleLocal: except BaseException,msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]") +def main(): + backupScheduleLocal.prepare() -backupScheduleLocal.prepare() \ No newline at end of file + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/static/filemanager/js/fileManager.js b/static/filemanager/js/fileManager.js index 3579f6501..c52c2d12e 100644 --- a/static/filemanager/js/fileManager.js +++ b/static/filemanager/js/fileManager.js @@ -5,7 +5,7 @@ fileManager.config(['$interpolateProvider', function($interpolateProvider) { $interpolateProvider.endSymbol('$}'); }]); -fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader) { +fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $window) { $( document.body ).click(function() { rightClickNode.style.display = "none"; @@ -1383,45 +1383,9 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader) { $scope.downloadFile = function() { url = "/filemanager/downloadFile"; - - var data = { - fileToDownload: $scope.currentPath + "/" + allFilesAndFolders[0], - domainRandomSeed:domainRandomSeed, - domainName: domainName - }; - - - $http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas); - - function ListInitialDatas(response) { - - var blob = new Blob([response.data]); - - //IE case - if (!!window.navigator.msSaveBlob){ - window.navigator.msSaveBlob(blob, allFilesAndFolders[0]); - return; - } - - //create blob and url - var url = URL.createObjectURL(blob); - - //create invisible acnhor, to specify the file name - var a = document.createElement('a'); - document.body.appendChild(a); - a.style = "display: none"; - a.href = url; - a.download = allFilesAndFolders[0]; - a.click(); - - setTimeout(function(){ - URL.revokeObjectURL(url); - document.body.removeChild(a); - }, 100); - } - - function cantLoadInitialDatas(response) {} - + var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0]; + var indexPublicHTML = downloadURL.indexOf("public_html") + 11; + $window.location.href = '/preview/' + domainName + downloadURL.slice(indexPublicHTML); }; diff --git a/static/loginSystem/login-systen.js b/static/loginSystem/login-systen.js index 05dfab8cd..30a56f0fe 100644 --- a/static/loginSystem/login-systen.js +++ b/static/loginSystem/login-systen.js @@ -73,9 +73,8 @@ application.controller('loginSystem', function($scope,$http,$window) { function ListInitialData(response) { - console.log(response.data) - if (response.data.loginStatus == 0) + if (response.data.loginStatus === 0) { $scope.errorMessage = response.data.error_message; $("#loginFailed").fadeIn(); @@ -89,9 +88,7 @@ application.controller('loginSystem', function($scope,$http,$window) { $("#verifyingLogin").hide(); } - function cantLoadInitialData(response) { - console.log("not good"); - } + function cantLoadInitialData(response) {} diff --git a/static/userManagment/userManagment.js b/static/userManagment/userManagment.js index 5e4d0f2f9..4c82b4068 100644 --- a/static/userManagment/userManagment.js +++ b/static/userManagment/userManagment.js @@ -533,7 +533,7 @@ app.controller('createACLCTRL', function($scope,$http) { var data = { aclName : $scope.aclName, - makeAdmin : $scope.makeAdmin = true, + makeAdmin : $scope.makeAdmin, // versionManagement : $scope.versionManagement,