bug fix to filemanager (change permissions)

This commit is contained in:
usmannasir
2019-02-12 01:57:35 +05:00
parent a8c4fc8f20
commit 5e6f3a97a5
5 changed files with 27 additions and 3 deletions

View File

@@ -317,5 +317,27 @@ class FileManager:
json_data = json.dumps(finalData)
return HttpResponse(json_data)
except BaseException, msg:
return self.ajaxPre(0, str(msg))
def changePermissions(self):
try:
finalData = {}
finalData['status'] = 1
if self.data['recursive'] == 1:
command = 'sudo chmod -R ' + self.data['newPermissions'] + ' ' + self.returnPathEnclosed(
self.data['basePath'] + '/' + self.data['permissionsPath'])
else:
command = 'sudo chmod ' + self.data['newPermissions'] + ' ' + self.returnPathEnclosed(
self.data['basePath'] + '/' + self.data['permissionsPath'])
ProcessUtilities.executioner(command)
json_data = json.dumps(finalData)
return HttpResponse(json_data)
except BaseException, msg:
return self.ajaxPre(0, str(msg))

View File

@@ -1551,7 +1551,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.changePermissionsLoading = true;
$('#showPermissions').modal('hide');
if (response.data.permissionsChanged === 1) {
if (response.data.status === 1) {
var notification = alertify.notify('Permissions Successfully Changed!', 'success', 5, function () {
});
$scope.fetchForTableSecondary(null, 'refresh');

View File

@@ -135,6 +135,8 @@ def controller(request):
return fm.extract()
elif method == 'compress':
return fm.compress()
elif method == 'changePermissions':
return fm.changePermissions()
except BaseException, msg:

View File

@@ -1551,7 +1551,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.changePermissionsLoading = true;
$('#showPermissions').modal('hide');
if (response.data.permissionsChanged === 1) {
if (response.data.status === 1) {
var notification = alertify.notify('Permissions Successfully Changed!', 'success', 5, function () {
});
$scope.fetchForTableSecondary(null, 'refresh');

View File

@@ -55,7 +55,7 @@
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Path" %}</label>
<div class="col-sm-6">
<input placeholder="Leave emtpy to install in website home directory. (Without preceding slash)" type="text" class="form-control" ng-model="installPath">
<input placeholder="Leave empty to install in website home directory. (Without preceding slash)" type="text" class="form-control" ng-model="installPath">
</div>
</div>