From ade4e4fed1fff41ce87c7c04e643fd83a01650bc Mon Sep 17 00:00:00 2001 From: "usman@cyberpersons.com" Date: Tue, 16 May 2023 15:16:21 +0500 Subject: [PATCH] apache as proxy --- managePHP/static/managePHP/managePHP.js | 88 ++++++++++++----- .../templates/managePHP/editPHPConfig.html | 2 +- .../managePHP/installExtensions.html | 2 +- managePHP/views.py | 97 +++++++++++++------ plogical/phpUtilities.py | 40 ++++++-- 5 files changed, 166 insertions(+), 63 deletions(-) diff --git a/managePHP/static/managePHP/managePHP.js b/managePHP/static/managePHP/managePHP.js index 519413c61..f91894cc9 100755 --- a/managePHP/static/managePHP/managePHP.js +++ b/managePHP/static/managePHP/managePHP.js @@ -63,8 +63,7 @@ app.controller('installExtensions', function ($scope, $http, $timeout) { $scope.canNotPerform = true; - } - else { + } else { $scope.canNotPerform = false; $scope.errorMessage = response.data.error_message; } @@ -121,8 +120,7 @@ app.controller('installExtensions', function ($scope, $http, $timeout) { $scope.canNotPerform = true; - } - else { + } else { $scope.canNotPerform = false; $scope.errorMessage = response.data.error_message; } @@ -145,7 +143,16 @@ app.controller('installExtensions', function ($scope, $http, $timeout) { var phpSelection = $scope.phpSelection; - url = "/managephp/getExtensionsInformation"; + var queryString = window.location.search; + var searchParams = new URLSearchParams(queryString); + + var param3Value = searchParams.get('apache'); + if (param3Value === null) { + url = "/managephp/getExtensionsInformation"; + console.log('Nothing found') + } else { + url = "/managephp/getExtensionsInformation?apache=apache"; + } var data = { phpSelection: phpSelection, @@ -175,8 +182,7 @@ app.controller('installExtensions', function ($scope, $http, $timeout) { $scope.couldNotConnect = true; - } - else { + } else { $scope.errorMessage = response.data.error_message; $scope.canNotFetch = false; $scope.couldNotConnect = true; @@ -227,16 +233,14 @@ app.controller('installExtensions', function ($scope, $http, $timeout) { $scope.goback = false; $timeout.cancel(); - } - else { + } else { size = Number(response.data.size); $scope.requestData = response.data.requestStatus; $timeout(getRequestStatus, 1000); } - } - else { + } else { } @@ -301,7 +305,7 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { if (!phpSelection) { return; } - + $scope.loadingPHP = false; $scope.canNotFetch = true; $scope.detailsSaved = true; @@ -312,7 +316,17 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { $('#file_uploads').bootstrapToggle('off'); $('#allow_url_include').bootstrapToggle('off'); - url = "/managephp/getCurrentPHPConfig"; + + var queryString = window.location.search; + var searchParams = new URLSearchParams(queryString); + + var param3Value = searchParams.get('apache'); + if (param3Value === null) { + url = "/managephp/getCurrentPHPConfig"; + console.log('Nothing found') + } else { + url = "/managephp/getCurrentPHPConfig?apache=apache"; + } var data = { phpSelection: phpSelection, @@ -360,8 +374,7 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { $scope.phpDetailsBox = false; - } - else { + } else { $scope.errorMessage = response.data.error_message; $scope.canNotFetch = false; @@ -387,7 +400,16 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { var phpSelection = $scope.phpSelection; - url = "/managephp/savePHPConfigBasic"; + var queryString = window.location.search; + var searchParams = new URLSearchParams(queryString); + + var param3Value = searchParams.get('apache'); + if (param3Value === null) { + url = "/managephp/savePHPConfigBasic"; + console.log('Nothing found') + } else { + url = "/managephp/savePHPConfigBasic?apache=apache"; + } var data = { phpSelection: phpSelection, @@ -420,8 +442,7 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { $scope.detailsSaved = false; $scope.loadingPHP = true; - } - else { + } else { $scope.errorMessage = response.data.error_message; $scope.canNotFetch = false; $scope.couldNotConnect = true; @@ -447,11 +468,20 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { if (!phpSelection) { return; } - + $scope.loadingPHP = false; $scope.savebtnAdvance = true; - url = "/managephp/getCurrentAdvancedPHPConfig"; + var queryString = window.location.search; + var searchParams = new URLSearchParams(queryString); + + var param3Value = searchParams.get('apache'); + if (param3Value === null) { + url = "/managephp/getCurrentAdvancedPHPConfig"; + console.log('Nothing found') + } else { + url = "/managephp/getCurrentAdvancedPHPConfig?apache=apache"; + } var data = { phpSelection: phpSelection, @@ -481,8 +511,7 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { $scope.savebtnAdvance = false; - } - else { + } else { $scope.canNotFetchAdvanced = false; $scope.detailsSavedAdvanced = true; $scope.loadingPHP = true; @@ -511,7 +540,17 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { var phpSelection = $scope.phpSelection; - url = "/managephp/savePHPConfigAdvance"; + var queryString = window.location.search; + var searchParams = new URLSearchParams(queryString); + + var param3Value = searchParams.get('apache'); + if (param3Value === null) { + url = "/managephp/savePHPConfigAdvance"; + console.log('Nothing found') + } else { + url = "/managephp/savePHPConfigAdvance?apache=apache"; + } + var data = { phpSelection: phpSelection, @@ -536,8 +575,7 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) { $scope.detailsSavedAdvanced = false; $scope.loadingPHP = true; - } - else { + } else { $scope.errorMessage = response.data.error_message; $scope.canNotFetchAdvanced = false; $scope.couldNotConnect = true; diff --git a/managePHP/templates/managePHP/editPHPConfig.html b/managePHP/templates/managePHP/editPHPConfig.html index 58eb8dc15..ad439c482 100755 --- a/managePHP/templates/managePHP/editPHPConfig.html +++ b/managePHP/templates/managePHP/editPHPConfig.html @@ -18,7 +18,7 @@

- {% trans "Edit PHP Configurations" %} + {% trans "Edit PHP Configurations" %} - {% if apache %}Edit Apache Configurations{% endif %}