fixed php config path for ubuntu

This commit is contained in:
usmannasir
2018-11-16 17:53:51 +05:00
parent bd7332039e
commit 0d76751e59
6 changed files with 3326 additions and 3328 deletions

View File

@@ -1427,7 +1427,14 @@ def getCurrentPHPConfig(request):
elif phpVers == "PHP 7.2":
phpVers = "php72"
if ProcessUtilities.decideServer() == ProcessUtilities.centos:
path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini"
else:
initial = phpVers[3]
final = phpVers[4]
completeName = str(initial) + '.' + str(final)
path = "/usr/local/lsws/ls" + phpVers + "/etc/php/" + completeName + "/litespeed/php.ini"
allow_url_fopen = "0"
display_errors = "0"
@@ -1605,7 +1612,14 @@ def getCurrentAdvancedPHPConfig(request):
elif phpVers == "PHP 7.2":
phpVers = "php72"
if ProcessUtilities.decideServer() == ProcessUtilities.centos:
path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini"
else:
initial = phpVers[3]
final = phpVers[4]
completeName = str(initial) + '.' + str(final)
path = "/usr/local/lsws/ls" + phpVers + "/etc/php/" + completeName + "/litespeed/php.ini"
configData = open(path, "r").read()
@@ -1651,7 +1665,14 @@ def savePHPConfigAdvance(request):
elif phpVers == "PHP 7.2":
phpVers = "php72"
if ProcessUtilities.decideServer() == ProcessUtilities.centos:
path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini"
else:
initial = phpVers[3]
final = phpVers[4]
completeName = str(initial) + '.' + str(final)
path = "/usr/local/lsws/ls" + phpVers + "/etc/php/" + completeName + "/litespeed/php.ini"
tempPath = "/home/cyberpanel/" + str(randint(1000, 9999))

View File

@@ -94,7 +94,14 @@ class phpUtilities:
def savePHPConfigBasic(phpVers,allow_url_fopen,display_errors,file_uploads,allow_url_include,memory_limit,max_execution_time,upload_max_filesize,max_input_time,post_max_size):
try:
if ProcessUtilities.decideServer() == ProcessUtilities.centos:
path = "/usr/local/lsws/ls" + phpVers + "/etc/php.ini"
else:
initial = phpVers[3]
final = phpVers[4]
completeName = str(initial) + '.' + str(final)
path = "/usr/local/lsws/ls" + phpVers + "/etc/php/" + completeName + "/litespeed/php.ini"
data = open(path, 'r').readlines()

View File

@@ -83,7 +83,6 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
if (response.data.fetchStatus === 1) {
/// node prepration
var ulNode = prepareChildNodeUL();
@@ -129,7 +128,9 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
//
var attachFunc = function(){ $scope.fetchChilds(aNode, completePath,"secondary"); };
var attachFunc = function () {
$scope.fetchChilds(aNode, completePath, "secondary");
};
var aNode = document.createElement('a');
aNode.setAttribute('href', '#');
@@ -167,7 +168,9 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
if (dropDown == true) {
secondANode.appendChild(iNodeFolder);
secondANode.appendChild(pathNode);
secondANode.addEventListener("click", function(){ $scope.fetchForTableSecondary(secondANode,"fromTree",completePath);});
secondANode.addEventListener("click", function () {
$scope.fetchForTableSecondary(secondANode, "fromTree", completePath);
});
// This makes completion of <a href="#"><i class="fa fa-folder" aria-hidden="true"></i> {{ startingPath }} </a>
@@ -208,7 +211,9 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
var aNode = document.createElement('a');
aNode.setAttribute('href', '#');
aNode.addEventListener("click", function(){ deleteChilds(aNode,completePath);});
aNode.addEventListener("click", function () {
deleteChilds(aNode, completePath);
});
aNode.setAttribute('onclick', 'return false;');
//
@@ -244,7 +249,9 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
var newANode = document.createElement('a');
newANode.setAttribute('href', '#');
newANode.addEventListener("click", function(){ $scope.fetchChilds(newANode, completePath,"secondary");});
newANode.addEventListener("click", function () {
$scope.fetchChilds(newANode, completePath, "secondary");
});
newANode.setAttribute('onclick', 'return false;');
//
@@ -366,8 +373,6 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
var permissionsNode = document.createTextNode(permissions);
//
@@ -411,9 +416,15 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
if (dirCheck == true) {
thNode.appendChild(iNodeFolder);
trNode.appendChild(thNode);
trNode.addEventListener("dblclick", function(){ $scope.fetchForTableSecondary(firstTDNode,"doubleClick");});
trNode.addEventListener("click", function(){ addFileOrFolderToList(trNode);});
trNode.addEventListener("contextmenu", function(event){$scope.rightClickCallBack(event,trNode);});
trNode.addEventListener("dblclick", function () {
$scope.fetchForTableSecondary(firstTDNode, "doubleClick");
});
trNode.addEventListener("click", function () {
addFileOrFolderToList(trNode);
});
trNode.addEventListener("contextmenu", function (event) {
$scope.rightClickCallBack(event, trNode);
});
// Hidden td to represent file or folder
@@ -423,8 +434,12 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
else {
thNode.appendChild(iNodeFile);
trNode.appendChild(thNode);
trNode.addEventListener("click", function(){ addFileOrFolderToList(trNode);});
trNode.addEventListener("contextmenu", function(event){ $scope.rightClickCallBack(event,trNode); });
trNode.addEventListener("click", function () {
addFileOrFolderToList(trNode);
});
trNode.addEventListener("contextmenu", function (event) {
$scope.rightClickCallBack(event, trNode);
});
// Hidden td to represent file or folder
@@ -595,15 +610,12 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
}
};
$scope.buttonActivator();
// table functions
$scope.fetchForTableSecondary = function (node, functionName) {
allFilesAndFolders = [];
@@ -628,8 +640,7 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
completePathToFile = $scope.currentPath;
var rightClickNode = document.getElementById("rightClick");
}
else if(functionName === "fromTree")
{
else if (functionName === "fromTree") {
completePathToFile = arguments[2];
}
@@ -685,7 +696,9 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
}
}
else {
var notification = alertify.notify(response.data.error_message, 'error', 10, function(){ console.log('dismissed'); });
var notification = alertify.notify(response.data.error_message, 'error', 10, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'homeFetch');
}
@@ -721,26 +734,25 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
domainRandomSeed = response.data.domainRandomSeed;
$scope.fetchForTableSecondary(null, "startPoint");
}
else
{
var notification = alertify.notify(response.data.error_message, 'error', 10, function(){ console.log('dismissed'); });
else {
var notification = alertify.notify(response.data.error_message, 'error', 10, function () {
console.log('dismissed');
});
}
}
function cantLoadInitialDatas(response) {
var notification = alertify.notify("Could not connec to server, refresh page.", 'error', 10, function(){ console.log('dismissed'); });
var notification = alertify.notify("Could not connec to server, refresh page.", 'error', 10, function () {
console.log('dismissed');
});
}
}
createEntryPoint();
// html editor
$scope.getFileContents = function () {
@@ -776,6 +788,7 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
}
}
function cantLoadInitialDatas(response) {
}
@@ -814,6 +827,7 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
}
}
function cantLoadInitialDatas(response) {
}
@@ -881,7 +895,6 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
}
var data = {
folderName: completePathForFolder,
method: "createNewFolder",
@@ -905,6 +918,7 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
}
}
function cantLoadInitialDatas(response) {
}
@@ -956,6 +970,7 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
}
}
function cantLoadInitialDatas(response) {
}
@@ -991,14 +1006,19 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
$scope.deleteLoading = true;
if (response.data.deleteStatus === 1) {
$('#showDelete').modal('hide');
var notification = alertify.notify('Successfully Deleted!', 'success', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Successfully Deleted!', 'success', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
else {
var notification = alertify.notify('Files/Folders can not be deleted', 'error', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Files/Folders can not be deleted', 'error', 5, function () {
console.log('dismissed');
});
}
}
function cantLoadInitialDatas(response) {
}
@@ -1043,14 +1063,19 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
$scope.compressionLoading = true;
$('#showCompression').modal('hide');
if (response.data.compressed === 1) {
var notification = alertify.notify('Successfully Compressed!', 'success', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Successfully Compressed!', 'success', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
else {
var notification = alertify.notify(response.data.error_message, 'error', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
console.log('dismissed');
});
}
}
function cantLoadInitialDatas(response) {
}
@@ -1101,14 +1126,19 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
$('#showExtraction').modal('hide');
if (response.data.extracted === 1) {
var notification = alertify.notify('Successfully Extracted!', 'success', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Successfully Extracted!', 'success', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
else {
var notification = alertify.notify(response.data.error_message, 'error', 10, function(){ console.log('dismissed'); });
var notification = alertify.notify(response.data.error_message, 'error', 10, function () {
console.log('dismissed');
});
}
}
function cantLoadInitialDatas(response) {
}
@@ -1155,14 +1185,19 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
$('#showMove').modal('hide');
if (response.data.moved === 1) {
var notification = alertify.notify('Successfully Moved!', 'success', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Successfully Moved!', 'success', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
else {
var notification = alertify.notify(response.data.error_message, 'error', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
console.log('dismissed');
});
}
}
function cantLoadInitialDatas(response) {
}
@@ -1208,14 +1243,19 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
$('#showCopy').modal('hide');
if (response.data.copied === 1) {
var notification = alertify.notify('Successfully Copied!', 'success', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Successfully Copied!', 'success', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
else {
var notification = alertify.notify(response.data.error_message, 'error', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
console.log('dismissed');
});
}
}
function cantLoadInitialDatas(response) {
}
@@ -1249,8 +1289,6 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
}
$scope.addFileOrFolderToListForRightClick(trNode);
};
@@ -1329,14 +1367,19 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
$scope.renameLoading = true;
if (response.data.renamed === 1) {
var notification = alertify.notify('Successfully Renamed!', 'success', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Successfully Renamed!', 'success', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
else {
var notification = alertify.notify(response.data.error_message, 'error', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
console.log('dismissed');
});
}
}
function cantLoadInitialDatas(response) {
}
@@ -1363,11 +1406,15 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
if (response.data.permissionsChanged === 1) {
var notification = alertify.notify('Permissions successfully fixed!', 'success', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Permissions successfully fixed!', 'success', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
else {
var notification = alertify.notify(response.data.error_message, 'error', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
@@ -1404,19 +1451,16 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
};
$scope.updateReadPermissions = function (value) {
switch (value) {
case 'userRead':
if($scope.userRead === true)
{
if ($scope.userRead === true) {
$scope.userPermissions = $scope.userPermissions + 4;
}
else
{
else {
if ($scope.userRead !== undefined) {
$scope.userPermissions = $scope.userPermissions - 4;
}
@@ -1453,12 +1497,10 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
case 'userWrite':
if($scope.userWrite === true)
{
if ($scope.userWrite === true) {
$scope.userPermissions = $scope.userPermissions + 2;
}
else
{
else {
if ($scope.userWrite !== undefined) {
$scope.userPermissions = $scope.userPermissions - 2;
}
@@ -1495,12 +1537,10 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
case 'userExecute':
if($scope.userExecute === true)
{
if ($scope.userExecute === true) {
$scope.userPermissions = $scope.userPermissions + 1;
}
else
{
else {
if ($scope.userExecute !== undefined) {
$scope.userPermissions = $scope.userPermissions - 1;
}
@@ -1561,23 +1601,25 @@ fileManager.controller('fileManagerCtrl', function($scope,$http,FileUploader, $w
$('#showPermissions').modal('hide');
if (response.data.permissionsChanged === 1) {
var notification = alertify.notify('Permissions Successfully Changed!', 'success', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify('Permissions Successfully Changed!', 'success', 5, function () {
console.log('dismissed');
});
$scope.fetchForTableSecondary(null, 'refresh');
}
else {
var notification = alertify.notify(response.data.error_message, 'error', 5, function(){ console.log('dismissed'); });
var notification = alertify.notify(response.data.error_message, 'error', 5, function () {
console.log('dismissed');
});
}
}
function cantLoadInitialDatas(response) {
}
};
});

View File

@@ -1268,9 +1268,6 @@ app.controller('modifyACLCtrl', function($scope,$http) {
};
});
/* Java script code to create acl ends here */

File diff suppressed because it is too large Load Diff