mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
bug fix to filemanager (change permissions)
This commit is contained in:
@@ -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))
|
||||
@@ -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');
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user