mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
CloudLinux, CageFS and security improvements
This commit is contained in:
283
static/filemanager/js/fileManager.js
Executable file → Normal file
283
static/filemanager/js/fileManager.js
Executable file → Normal file
@@ -1,3 +1,20 @@
|
||||
function getCookie(name) {
|
||||
var cookieValue = null;
|
||||
if (document.cookie && document.cookie !== '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) === (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
|
||||
|
||||
var fileManager = angular.module('fileManager', ['angularFileUpload']);
|
||||
|
||||
fileManager.config(['$interpolateProvider', function ($interpolateProvider) {
|
||||
@@ -5,6 +22,7 @@ fileManager.config(['$interpolateProvider', function ($interpolateProvider) {
|
||||
$interpolateProvider.endSymbol('$}');
|
||||
}]);
|
||||
|
||||
|
||||
fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader, $window) {
|
||||
|
||||
$(document.body).click(function () {
|
||||
@@ -58,8 +76,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
if (functionName === "primary") {
|
||||
nodeForChilds = element.currentTarget.parentNode;
|
||||
funcCompletePath = completePath;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
nodeForChilds = element.parentNode;
|
||||
funcCompletePath = completePath;
|
||||
}
|
||||
@@ -74,7 +91,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -95,8 +119,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
if (keys[i] === "error_message" | keys[i] === "status") {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
path = filesData[keys[i]][0];
|
||||
completePath = filesData[keys[i]][1];
|
||||
dropDown = filesData[keys[i]][2];
|
||||
@@ -105,8 +128,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
}
|
||||
|
||||
activateMinus(nodeForChilds, funcCompletePath);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -185,8 +207,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
liNode.appendChild(secondANode);
|
||||
|
||||
return liNode;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
liNode.appendChild(iNodeFile);
|
||||
liNode.appendChild(pathNode);
|
||||
return liNode;
|
||||
@@ -430,8 +451,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
var fileOrFolderNode = document.createTextNode("Folder");
|
||||
fifthTDNode.appendChild(fileOrFolderNode)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
thNode.appendChild(iNodeFile);
|
||||
trNode.appendChild(thNode);
|
||||
trNode.addEventListener("click", function () {
|
||||
@@ -475,40 +495,32 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
if (result[0] === "js") {
|
||||
aceEditorMode = "ace/mode/javascript";
|
||||
editNotRight.style.display = "Block";
|
||||
}
|
||||
else if (result[0] === "html") {
|
||||
} else if (result[0] === "html") {
|
||||
aceEditorMode = "ace/mode/html";
|
||||
editNotRight.style.display = "Block";
|
||||
}
|
||||
else if (result[0] === "css") {
|
||||
} else if (result[0] === "css") {
|
||||
aceEditorMode = "ace/mode/css";
|
||||
editNotRight.style.display = "Block";
|
||||
}
|
||||
else if (result[0] === "php") {
|
||||
} else if (result[0] === "php") {
|
||||
aceEditorMode = "ace/mode/php";
|
||||
editNotRight.style.display = "Block";
|
||||
}
|
||||
else if (result[0] === "txt") {
|
||||
} else if (result[0] === "txt") {
|
||||
aceEditorMode = "";
|
||||
editNotRight.style.display = "Block";
|
||||
}
|
||||
else if (result[0] === "htaccess") {
|
||||
} else if (result[0] === "htaccess") {
|
||||
aceEditorMode = "";
|
||||
editNotRight.style.display = "Block";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var editNode = document.getElementById("editFile");
|
||||
editNode.style.pointerEvents = "none";
|
||||
editNotRight.style.display = "None";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var editNode = document.getElementById("editFile");
|
||||
editNode.style.pointerEvents = "none";
|
||||
editNotRight.style.display = "None";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var editNode = document.getElementById("editFile");
|
||||
editNode.style.pointerEvents = "none";
|
||||
}
|
||||
@@ -527,21 +539,18 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
if (result[0] === "gz") {
|
||||
extractFileNode.style.pointerEvents = "auto";
|
||||
extractNodeRight.style.display = "Block";
|
||||
}
|
||||
else if (result[0] === "zip") {
|
||||
} else if (result[0] === "zip") {
|
||||
extractFileNode.style.pointerEvents = "auto";
|
||||
extractNodeRight.style.display = "Block";
|
||||
} else {
|
||||
extractFileNode.style.pointerEvents = "none";
|
||||
extractNodeRight.style.display = "None";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
extractFileNode.style.pointerEvents = "none";
|
||||
extractNodeRight.style.display = "None";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var extractFileNode = document.getElementById("extractFile");
|
||||
extractFileNode.style.pointerEvents = "none";
|
||||
}
|
||||
@@ -553,8 +562,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
var moveFileNode = document.getElementById("moveFile");
|
||||
moveFileNode.style.pointerEvents = "auto";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var moveFileNode = document.getElementById("moveFile");
|
||||
moveFileNode.style.pointerEvents = "none";
|
||||
}
|
||||
@@ -565,8 +573,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
var copeFileNode = document.getElementById("copyFile");
|
||||
copeFileNode.style.pointerEvents = "auto";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var copeFileNode = document.getElementById("copyFile");
|
||||
copeFileNode.style.pointerEvents = "none";
|
||||
}
|
||||
@@ -578,8 +585,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
var renameFileNode = document.getElementById("renameFile");
|
||||
renameFileNode.style.pointerEvents = "auto";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var renameFileNode = document.getElementById("renameFile");
|
||||
renameFileNode.style.pointerEvents = "none";
|
||||
}
|
||||
@@ -590,8 +596,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
if (allFilesAndFolders.length >= 1) {
|
||||
var compressFile = document.getElementById("compressFile");
|
||||
compressFile.style.pointerEvents = "auto";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var compressFile = document.getElementById("compressFile");
|
||||
compressFile.style.pointerEvents = "none";
|
||||
}
|
||||
@@ -603,8 +608,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
var deleteFile = document.getElementById("deleteFile");
|
||||
deleteFile.style.pointerEvents = "auto";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var deleteFile = document.getElementById("deleteFile");
|
||||
deleteFile.style.pointerEvents = "none";
|
||||
}
|
||||
@@ -625,22 +629,17 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
if (functionName === "startPoint") {
|
||||
completePathToFile = $scope.currentPath;
|
||||
}
|
||||
else if (functionName === "doubleClick") {
|
||||
} else if (functionName === "doubleClick") {
|
||||
completePathToFile = $scope.currentPath + "/" + node.innerHTML;
|
||||
}
|
||||
else if (functionName === "homeFetch") {
|
||||
} else if (functionName === "homeFetch") {
|
||||
completePathToFile = homePathBack;
|
||||
}
|
||||
else if (functionName === "goBackOnPath") {
|
||||
} else if (functionName === "goBackOnPath") {
|
||||
var pos = $scope.currentPath.lastIndexOf("/");
|
||||
completePathToFile = $scope.currentPath.slice(0, pos);
|
||||
}
|
||||
else if (functionName === "refresh") {
|
||||
} else if (functionName === "refresh") {
|
||||
completePathToFile = $scope.currentPath;
|
||||
var rightClickNode = document.getElementById("rightClick");
|
||||
}
|
||||
else if (functionName === "fromTree") {
|
||||
} else if (functionName === "fromTree") {
|
||||
completePathToFile = arguments[2];
|
||||
}
|
||||
|
||||
@@ -659,7 +658,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
tableBody.innerHTML = '<img src="' + loadingPath + '">';
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -678,8 +684,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
if (keys[i] === "error_message" | keys[i] === "status") {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var fileName = filesData[keys[i]][0];
|
||||
var lastModified = filesData[keys[i]][2];
|
||||
var fileSize = filesData[keys[i]][3];
|
||||
@@ -694,8 +699,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify(response.data.error_message, 'error', 10, function () {
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'homeFetch');
|
||||
@@ -711,6 +715,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
function findFileExtension(fileName) {
|
||||
return (/[.]/.exec(fileName)) ? /[^.]+$/.exec(fileName) : undefined;
|
||||
}
|
||||
|
||||
$scope.fetchForTableSecondary(null, "startPoint");
|
||||
|
||||
// html editor
|
||||
@@ -727,8 +732,15 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
domainName: domainName
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -741,8 +753,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
editor.getSession().setMode(aceEditorMode);
|
||||
editor.setValue(response.data.fileContents);
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.errorMessageEditor = false;
|
||||
$scope.error_message = response.data.error_message;
|
||||
}
|
||||
@@ -771,7 +782,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -780,8 +798,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
if (response.data.status === 1) {
|
||||
$scope.htmlEditorLoading = true;
|
||||
$scope.saveSuccess = false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.errorMessageEditor = false;
|
||||
$scope.error_message = response.data.error_message;
|
||||
}
|
||||
@@ -800,6 +817,9 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
var uploader = $scope.uploader = new FileUploader({
|
||||
url: "/filemanager/upload",
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken') // X-CSRF-TOKEN is used for Ruby on Rails Tokens
|
||||
},
|
||||
formData: [{
|
||||
"method": "upload",
|
||||
"home": homePathBack
|
||||
@@ -810,8 +830,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
if (response.uploadStatus === 1) {
|
||||
$scope.errorMessage = true;
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.errorMessage = false;
|
||||
$scope.fileName = response.fileName;
|
||||
$scope.error_message = response.error_message;
|
||||
@@ -863,7 +882,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
var url = '/filemanager/controller';
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -871,8 +897,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
$scope.createSuccess = false;
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
$('#showCreateFolder').modal('hide');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.errorMessageFolder = false;
|
||||
$scope.error_message = response.data.error_message;
|
||||
}
|
||||
@@ -915,7 +940,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -923,8 +955,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
$scope.createSuccess = false;
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
$('#showCreateFile').modal('hide');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.errorMessageFile = false;
|
||||
$scope.error_message = response.data.error_message;
|
||||
}
|
||||
@@ -960,7 +991,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.deleteLoading = true;
|
||||
@@ -969,8 +1007,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
var notification = alertify.notify('Successfully Deleted!', 'success', 5, function () {
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify('Files/Folders can not be deleted', 'error', 5, function () {
|
||||
console.log('dismissed');
|
||||
});
|
||||
@@ -1015,7 +1052,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -1025,8 +1069,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
var notification = alertify.notify('Successfully Compressed!', 'success', 5, function () {
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
|
||||
});
|
||||
}
|
||||
@@ -1058,8 +1101,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
if (findFileExtension(completeFileToExtract) == "gz") {
|
||||
extractionType = "tar.gz";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
extractionType = "zip";
|
||||
}
|
||||
|
||||
@@ -1075,7 +1117,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -1087,8 +1136,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
console.log('dismissed');
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify(response.data.error_message, 'error', 10, function () {
|
||||
console.log('dismissed');
|
||||
});
|
||||
@@ -1134,7 +1182,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -1145,8 +1200,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
var notification = alertify.notify('Successfully Moved!', 'success', 5, function () {
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
|
||||
});
|
||||
}
|
||||
@@ -1190,7 +1244,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.copyLoading = true;
|
||||
@@ -1201,8 +1262,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
var notification = alertify.notify('Successfully Copied!', 'success', 5, function () {
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
|
||||
});
|
||||
}
|
||||
@@ -1311,7 +1371,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -1323,8 +1390,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
var notification = alertify.notify('Successfully Renamed!', 'success', 5, function () {
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
|
||||
});
|
||||
}
|
||||
@@ -1351,7 +1417,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -1361,8 +1434,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
console.log('dismissed');
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
|
||||
console.log('dismissed');
|
||||
});
|
||||
@@ -1410,8 +1482,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
if ($scope.userRead === true) {
|
||||
$scope.userPermissions = $scope.userPermissions + 4;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($scope.userRead !== undefined) {
|
||||
$scope.userPermissions = $scope.userPermissions - 4;
|
||||
}
|
||||
@@ -1450,8 +1521,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
if ($scope.userWrite === true) {
|
||||
$scope.userPermissions = $scope.userPermissions + 2;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($scope.userWrite !== undefined) {
|
||||
$scope.userPermissions = $scope.userPermissions - 2;
|
||||
}
|
||||
@@ -1490,8 +1560,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
|
||||
if ($scope.userExecute === true) {
|
||||
$scope.userPermissions = $scope.userPermissions + 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($scope.userExecute !== undefined) {
|
||||
$scope.userPermissions = $scope.userPermissions - 1;
|
||||
}
|
||||
@@ -1544,7 +1613,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
@@ -1555,8 +1631,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
|
||||
var notification = alertify.notify('Permissions Successfully Changed!', 'success', 5, function () {
|
||||
});
|
||||
$scope.fetchForTableSecondary(null, 'refresh');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user