mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
wphomechanges1
This commit is contained in:
@@ -463,6 +463,8 @@ function DeployToProductionInitial(vall) {
|
|||||||
|
|
||||||
app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $window) {
|
app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $window) {
|
||||||
|
|
||||||
|
var CheckBoxpasssword = 0;
|
||||||
|
|
||||||
$scope.wordpresshomeloading = true;
|
$scope.wordpresshomeloading = true;
|
||||||
$scope.stagingDetailsForm = false;
|
$scope.stagingDetailsForm = false;
|
||||||
$scope.installationProgress = true;
|
$scope.installationProgress = true;
|
||||||
@@ -519,6 +521,29 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
if (response.data.ret_data.maintenanceMode === 1) {
|
if (response.data.ret_data.maintenanceMode === 1) {
|
||||||
$('#maintenanceMode').prop('checked', true);
|
$('#maintenanceMode').prop('checked', true);
|
||||||
}
|
}
|
||||||
|
if(response.data.ret_data.wpcron === 1) {
|
||||||
|
$('#wpcron').prop('checked', true);
|
||||||
|
}
|
||||||
|
if (response.data.ret_data.passwordprotection == 1) {
|
||||||
|
|
||||||
|
var dc = '<input type="checkbox" checked \n' +
|
||||||
|
' ng-click="UpdateWPSettings(\'PasswordProtection\')" class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"\n' +
|
||||||
|
' id="passwdprotection">\n' +
|
||||||
|
' <label class="custom-control-label"\n' +
|
||||||
|
' for="passwdprotection"></label>'
|
||||||
|
var mp = $compile(dc)($scope);
|
||||||
|
angular.element(document.getElementById('prsswdprodata')).append(mp);
|
||||||
|
CheckBoxpasssword = 1;
|
||||||
|
} else if (response.data.ret_data.passwordprotection == 0) {
|
||||||
|
var dc = '<input type="checkbox" data-toggle="modal"\n' +
|
||||||
|
' data-target="#Passwordprotection"\n' +
|
||||||
|
' class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"\n' +
|
||||||
|
' id="passwdprotection">\n' +
|
||||||
|
' <label class="custom-control-label"\n' +
|
||||||
|
' for="passwdprotection"></label>'
|
||||||
|
$('#prsswdprodata').append(dc);
|
||||||
|
CheckBoxpasssword = 0;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
new PNotify({
|
new PNotify({
|
||||||
@@ -550,17 +575,31 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
$scope.UpdateWPSettings = function (setting) {
|
$scope.UpdateWPSettings = function (setting) {
|
||||||
|
|
||||||
$scope.wordpresshomeloading = false;
|
$scope.wordpresshomeloading = false;
|
||||||
|
$('#wordpresshomeloading').show();
|
||||||
|
|
||||||
|
|
||||||
var url = "/websites/UpdateWPSettings";
|
var url = "/websites/UpdateWPSettings";
|
||||||
|
|
||||||
if (setting === "PasswordProtection") {
|
if (setting === "PasswordProtection") {
|
||||||
var data = {
|
if (CheckBoxpasssword == 0) {
|
||||||
WPid: $('#WPid').html(),
|
var data = {
|
||||||
setting: setting,
|
WPid: $('#WPid').html(),
|
||||||
PPUsername: $scope.PPUsername,
|
setting: setting,
|
||||||
PPPassword: $scope.PPPassword,
|
PPUsername: $scope.PPUsername,
|
||||||
|
PPPassword: $scope.PPPassword,
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
var data = {
|
||||||
|
WPid: $('#WPid').html(),
|
||||||
|
setting: setting,
|
||||||
|
PPUsername: '',
|
||||||
|
PPPassword: '',
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var settingValue = 0;
|
var settingValue = 0;
|
||||||
if ($('#' + setting).is(":checked")) {
|
if ($('#' + setting).is(":checked")) {
|
||||||
@@ -586,6 +625,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
|
|
||||||
function ListInitialDatas(response) {
|
function ListInitialDatas(response) {
|
||||||
$scope.wordpresshomeloading = true;
|
$scope.wordpresshomeloading = true;
|
||||||
|
$('#wordpresshomeloading').hide();
|
||||||
|
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
new PNotify({
|
new PNotify({
|
||||||
@@ -605,6 +645,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
function cantLoadInitialDatas(response) {
|
||||||
|
$('#wordpresshomeloading').hide();
|
||||||
$scope.wordpresshomeloading = true;
|
$scope.wordpresshomeloading = true;
|
||||||
alert(response)
|
alert(response)
|
||||||
|
|
||||||
@@ -1523,7 +1564,8 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
|
|
||||||
$scope.installwpcore = function () {
|
$scope.installwpcore = function () {
|
||||||
|
|
||||||
$('#wordpresshomeloading').show();
|
$('#wordpresshomeloading').show();
|
||||||
|
$('#wordpresshomeloadingsec').show();
|
||||||
var data = {
|
var data = {
|
||||||
WPid: $('#WPid').html(),
|
WPid: $('#WPid').html(),
|
||||||
}
|
}
|
||||||
@@ -1544,6 +1586,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
|
|
||||||
function ListInitialDatas(response) {
|
function ListInitialDatas(response) {
|
||||||
$('#wordpresshomeloading').hide();
|
$('#wordpresshomeloading').hide();
|
||||||
|
$('#wordpresshomeloadingsec').hide();
|
||||||
$scope.wordpresshomeloading = true;
|
$scope.wordpresshomeloading = true;
|
||||||
|
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
@@ -1565,6 +1608,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
function cantLoadInitialDatas(response) {
|
||||||
$('#wordpresshomeloading').hide();
|
$('#wordpresshomeloading').hide();
|
||||||
|
$('#wordpresshomeloadingsec').hide();
|
||||||
$scope.wordpresshomeloading = true;
|
$scope.wordpresshomeloading = true;
|
||||||
alert(response)
|
alert(response)
|
||||||
|
|
||||||
@@ -1574,7 +1618,8 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
|
|
||||||
$scope.dataintegrity = function () {
|
$scope.dataintegrity = function () {
|
||||||
|
|
||||||
$('#wordpresshomeloading').show();
|
$('#wordpresshomeloading').show();
|
||||||
|
$('#wordpresshomeloadingsec').show();
|
||||||
var data = {
|
var data = {
|
||||||
WPid: $('#WPid').html(),
|
WPid: $('#WPid').html(),
|
||||||
}
|
}
|
||||||
@@ -1595,6 +1640,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
|
|
||||||
function ListInitialDatas(response) {
|
function ListInitialDatas(response) {
|
||||||
$('#wordpresshomeloading').hide();
|
$('#wordpresshomeloading').hide();
|
||||||
|
$('#wordpresshomeloadingsec').hide();
|
||||||
$scope.wordpresshomeloading = true;
|
$scope.wordpresshomeloading = true;
|
||||||
|
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
@@ -1616,6 +1662,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
|
|
||||||
function cantLoadInitialDatas(response) {
|
function cantLoadInitialDatas(response) {
|
||||||
$('#wordpresshomeloading').hide();
|
$('#wordpresshomeloading').hide();
|
||||||
|
$('#wordpresshomeloadingsec').hide();
|
||||||
$scope.wordpresshomeloading = true;
|
$scope.wordpresshomeloading = true;
|
||||||
alert(response)
|
alert(response)
|
||||||
|
|
||||||
@@ -1707,7 +1754,7 @@ app.controller('RestoreWPBackup', function ($scope, $http, $timeout, $window) {
|
|||||||
if (typeof path != 'undefined' || path != '') {
|
if (typeof path != 'undefined' || path != '') {
|
||||||
home = "0";
|
home = "0";
|
||||||
}
|
}
|
||||||
if (typeof path == 'undefined' ) {
|
if (typeof path == 'undefined') {
|
||||||
path = "";
|
path = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,63 +130,15 @@
|
|||||||
for="lscache"></label>
|
for="lscache"></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<span style="display: none" id="#checkjq"></span>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<h6 style="font-weight: bold">Password Protection</h6>
|
<h6 style="font-weight: bold">Password Protection</h6>
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch" id="prsswdprodata">
|
||||||
<input type="radio" data-toggle="modal"
|
|
||||||
data-target="#Passwordprotection"
|
|
||||||
class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"
|
|
||||||
id="passwdprotection">
|
|
||||||
<label class="custom-control-label"
|
|
||||||
for="passwdprotection"></label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!------------------MOdael for passwd protection-------->
|
|
||||||
<div id="Passwordprotection" class="modal fade" role="dialog">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<!-- Modal content-->
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<button type="button" class="close" data-dismiss="modal">×
|
|
||||||
</button>
|
|
||||||
<h4 class="modal-title">Delete WordPress Site
|
|
||||||
<img ng-hide="$parent.cyberPanelLoading"
|
|
||||||
src="/static/images/loading.gif"
|
|
||||||
style="display: none;">
|
|
||||||
</h4>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body" style="height: 100px;">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label class="col-sm-4">Username</label>
|
|
||||||
<input ng-model="$parent.PPUsername" required class="col-lg-8"
|
|
||||||
type="text" placeholder="Username">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div style="margin-top: 36px;">
|
|
||||||
<label class="col-sm-4">Password</label>
|
|
||||||
<input ng-model="$parent.PPPassword" required class="col-lg-8"
|
|
||||||
type="password" placeholder="*******************">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-primary"
|
|
||||||
ng-click="UpdateWPSettings('PasswordProtection')">Yes
|
|
||||||
</button>
|
|
||||||
<button type="button" ng-disabled="savingSettings"
|
|
||||||
class="btn btn-default" data-dismiss="modal">
|
|
||||||
Cancel
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!------------------End MOdael for passwd protection-------->
|
|
||||||
<div style="margin-top: 4%">
|
<div style="margin-top: 4%">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
@@ -223,14 +175,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<h6 style="font-weight: bold"> WP Corn</h6>
|
<h6 style="font-weight: bold"> WP Cron</h6>
|
||||||
<div class="custom-control custom-switch">
|
<div class="custom-control custom-switch">
|
||||||
<input
|
<input ng-click="UpdateWPSettings('Wpcron')"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
class="custom-control-input ng-pristine ng-untouched ng-valid ng-empty"
|
class="custom-control-input ng-pristine ng-untouched ng-valid ng-empty"
|
||||||
id="maintenanceMode">
|
id="wpcron">
|
||||||
<label class="custom-control-label"
|
<label class="custom-control-label"
|
||||||
for="maintenanceMode"></label>
|
for="wpcron"></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -429,7 +381,10 @@
|
|||||||
<div class="tab-pane" id="tab5">
|
<div class="tab-pane" id="tab5">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<h3 class="content-box-header">
|
<h3 class="content-box-header">
|
||||||
{% trans "Create Backup " %} - <a href="{% url 'RestoreBackups' %}">{% trans "Restore Backups " %} <i class="glyph-icon icon-external-link-square" title="staging.cyberpanel.net"></i></a>
|
{% trans "Create Backup " %} - <a
|
||||||
|
href="{% url 'RestoreBackups' %}">{% trans "Restore Backups " %} <i
|
||||||
|
class="glyph-icon icon-external-link-square"
|
||||||
|
title="staging.cyberpanel.net"></i></a>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="example-box-wrapper">
|
<div class="example-box-wrapper">
|
||||||
|
|
||||||
@@ -515,7 +470,9 @@
|
|||||||
<label class="col-sm-2 control-label mb-5"
|
<label class="col-sm-2 control-label mb-5"
|
||||||
style="padding-top: 0px;">{% trans "Database Name" %}</label>
|
style="padding-top: 0px;">{% trans "Database Name" %}</label>
|
||||||
<div class="col-sm-1 mb-10">
|
<div class="col-sm-1 mb-10">
|
||||||
<a target="_blank" href="{% url 'phpMyAdmin' %}"> <div id="DB_Name" class="mb-10 text-bold"></div></a>
|
<a target="_blank" href="{% url 'phpMyAdmin' %}">
|
||||||
|
<div id="DB_Name" class="mb-10 text-bold"></div>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -597,6 +554,51 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!------------------MOdael for passwd protection-------->
|
||||||
|
<div id="Passwordprotection" class="modal fade" role="dialog">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<!-- Modal content-->
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title">Enable Password Protection
|
||||||
|
<img ng-hide="$parent.cyberPanelLoading"
|
||||||
|
src="/static/images/loading.gif"
|
||||||
|
style="display: none;">
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body" style="height: 100px;">
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label class="col-sm-4">Username</label>
|
||||||
|
<input ng-model="$parent.PPUsername" required class="col-lg-8"
|
||||||
|
type="text" placeholder="Username">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 36px;">
|
||||||
|
<label class="col-sm-4">Password</label>
|
||||||
|
<input ng-model="$parent.PPPassword" required class="col-lg-8"
|
||||||
|
type="password" placeholder="*******************">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
ng-click="UpdateWPSettings('PasswordProtection')">Yes
|
||||||
|
</button>
|
||||||
|
<button type="button" ng-disabled="savingSettings"
|
||||||
|
class="btn btn-default" data-dismiss="modal">
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!------------------End MOdael for passwd protection-------->
|
||||||
|
|
||||||
<!-------Start Model of AutoUpdateCongiguration-->
|
<!-------Start Model of AutoUpdateCongiguration-->
|
||||||
<div id="autoUpdateConfig" class="modal fade" tabindex="-1" role="dialog"
|
<div id="autoUpdateConfig" class="modal fade" tabindex="-1" role="dialog"
|
||||||
aria-hidden="true">
|
aria-hidden="true">
|
||||||
@@ -684,17 +686,20 @@
|
|||||||
<button type="button" class="close" data-dismiss="modal">
|
<button type="button" class="close" data-dismiss="modal">
|
||||||
×
|
×
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">{% trans "Security" %}</h4>
|
<h4 class="modal-title">{% trans "Security" %}<img style="display: none"
|
||||||
|
id="wordpresshomeloadingsec"
|
||||||
|
ng-hide="wordpresshomeloading"
|
||||||
|
src="{% static 'images/loading.gif' %}"></h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body center-div">
|
<div class="modal-body center-div">
|
||||||
<button
|
<button
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
data-target="#DeleteMember" aria-label=""
|
data-target="#DeleteMember" aria-label=""
|
||||||
ng-click="dataintegrity()"
|
ng-click="dataintegrity()"
|
||||||
type="button" class="btn btn-border btn-alt border-azure btn-link font-black">
|
type="button" class="btn btn-border btn-alt border-azure btn-link font-black">
|
||||||
data integrity
|
data integrity
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
data-target="#DeleteMember" aria-label=""
|
data-target="#DeleteMember" aria-label=""
|
||||||
ng-click="installwpcore()"
|
ng-click="installwpcore()"
|
||||||
|
|||||||
@@ -615,12 +615,33 @@ class WebsiteManager:
|
|||||||
else:
|
else:
|
||||||
maintenanceMode = 1
|
maintenanceMode = 1
|
||||||
|
|
||||||
|
|
||||||
|
##### Check passwd protection
|
||||||
|
vhostName = wpsite.owner.domain
|
||||||
|
vhostPassDir = f'/home/{vhostName}'
|
||||||
|
path = f'{vhostPassDir}/{WPManagerID}'
|
||||||
|
if os.path.exists(path):
|
||||||
|
passwd = 0
|
||||||
|
else:
|
||||||
|
passwd = 1
|
||||||
|
|
||||||
|
|
||||||
|
#### Check WP cron
|
||||||
|
command = "sudo -u %s cat %s/wp-config.php"%(Vhuser, wpsite.path)
|
||||||
|
stdout = ProcessUtilities.outputExecutioner(command)
|
||||||
|
if stdout.find("'DISABLE_WP_CRON', 'true'") > -1:
|
||||||
|
wpcron = 1
|
||||||
|
else:
|
||||||
|
wpcron = 0
|
||||||
|
|
||||||
fb ={
|
fb ={
|
||||||
'version': version.rstrip('\n'),
|
'version': version.rstrip('\n'),
|
||||||
'lscache': lscache,
|
'lscache': lscache,
|
||||||
'debugging': debugging,
|
'debugging': debugging,
|
||||||
'searchIndex': searchindex,
|
'searchIndex': searchindex,
|
||||||
'maintenanceMode': maintenanceMode
|
'maintenanceMode': maintenanceMode,
|
||||||
|
'passwordprotection': passwd,
|
||||||
|
'wpcron': wpcron
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -977,9 +998,36 @@ class WebsiteManager:
|
|||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
WPid = data['WPid']
|
WPManagerID = data['WPid']
|
||||||
|
wpsite = WPSites.objects.get(pk=WPManagerID)
|
||||||
|
|
||||||
|
if ACLManager.checkOwnership(wpsite.owner.domain, admin, currentACL) == 1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
return ACLManager.loadError()
|
||||||
|
|
||||||
|
path = wpsite.path
|
||||||
|
|
||||||
|
Webobj = Websites.objects.get(pk=wpsite.owner_id)
|
||||||
|
|
||||||
|
Vhuser = Webobj.externalApp
|
||||||
|
PHPVersion = Webobj.phpSelection
|
||||||
|
|
||||||
|
php = ACLManager.getPHPString(PHPVersion)
|
||||||
|
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
|
||||||
|
|
||||||
|
###fetch WP version
|
||||||
|
|
||||||
|
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp core version --skip-plugins --skip-themes --path=%s' % (
|
||||||
|
Vhuser, FinalPHPPath, path)
|
||||||
|
version = ProcessUtilities.outputExecutioner(command)
|
||||||
|
version = version.rstrip("\n")
|
||||||
|
|
||||||
|
###install wp core
|
||||||
|
command = "sudo -u %s wp core download --force --skip-content --version=%s"%(Vhuser, version)
|
||||||
|
output = ProcessUtilities.outputExecutioner(command)
|
||||||
|
|
||||||
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',}
|
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
@@ -997,9 +1045,33 @@ class WebsiteManager:
|
|||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
WPid = data['WPid']
|
WPManagerID = data['WPid']
|
||||||
|
wpsite = WPSites.objects.get(pk=WPManagerID)
|
||||||
|
|
||||||
|
if ACLManager.checkOwnership(wpsite.owner.domain, admin, currentACL) == 1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
return ACLManager.loadError()
|
||||||
|
|
||||||
|
path = wpsite.path
|
||||||
|
|
||||||
|
Webobj = Websites.objects.get(pk=wpsite.owner_id)
|
||||||
|
|
||||||
|
Vhuser = Webobj.externalApp
|
||||||
|
PHPVersion = Webobj.phpSelection
|
||||||
|
|
||||||
|
php = ACLManager.getPHPString(PHPVersion)
|
||||||
|
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
|
||||||
|
|
||||||
|
###fetch WP version
|
||||||
|
|
||||||
|
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp core version --skip-plugins --skip-themes --path=%s' % (
|
||||||
|
Vhuser, FinalPHPPath, path)
|
||||||
|
version = ProcessUtilities.outputExecutioner(command)
|
||||||
|
version = version.rstrip("\n")
|
||||||
|
|
||||||
|
###dataintegrity
|
||||||
|
|
||||||
time.sleep(2)
|
|
||||||
|
|
||||||
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',}
|
data_ret = {'status': 1, 'installStatus': 1, 'error_message': 'None',}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
@@ -1440,6 +1512,8 @@ class WebsiteManager:
|
|||||||
else:
|
else:
|
||||||
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp option update blog_public 0 --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path)
|
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp option update blog_public 0 --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path)
|
||||||
stdoutput = ProcessUtilities.outputExecutioner(command)
|
stdoutput = ProcessUtilities.outputExecutioner(command)
|
||||||
|
|
||||||
|
|
||||||
elif setting == 'maintenanceMode':
|
elif setting == 'maintenanceMode':
|
||||||
|
|
||||||
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path)
|
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp litespeed-purge all --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path)
|
||||||
@@ -1454,12 +1528,19 @@ class WebsiteManager:
|
|||||||
else:
|
else:
|
||||||
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp maintenance-mode deactivate --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path)
|
command = "sudo -u %s %s -d error_reporting=0 /usr/bin/wp maintenance-mode deactivate --path=%s --skip-plugins --skip-themes" % (Vhuser, FinalPHPPath, path)
|
||||||
stdoutput = ProcessUtilities.outputExecutioner(command)
|
stdoutput = ProcessUtilities.outputExecutioner(command)
|
||||||
|
|
||||||
|
|
||||||
elif setting == 'PasswordProtection':
|
elif setting == 'PasswordProtection':
|
||||||
execPath = f"/usr/local/CyberCP/bin/python {virtualHostUtilities.cyberPanel}/plogical/virtualHostUtilities.py"
|
execPath = f"/usr/local/CyberCP/bin/python {virtualHostUtilities.cyberPanel}/plogical/virtualHostUtilities.py"
|
||||||
execPath = f"{execPath} EnableDisablePP --username '{PPUsername}' --password '{PPPassword}' " \
|
execPath = f"{execPath} EnableDisablePP --username '{PPUsername}' --password '{PPPassword}' " \
|
||||||
f"--virtualHostName {Webobj.domain} --path {path} --wpid {str(wpsite.id)} --virtualHostUser {Webobj.externalApp}"
|
f"--virtualHostName {Webobj.domain} --path {path} --wpid {str(wpsite.id)} --virtualHostUser {Webobj.externalApp}"
|
||||||
ProcessUtilities.executioner(execPath)
|
ProcessUtilities.executioner(execPath)
|
||||||
|
|
||||||
|
elif setting == 'Wpcron':
|
||||||
|
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp core version --skip-plugins --skip-themes --path=%s' % (
|
||||||
|
Vhuser, FinalPHPPath, path)
|
||||||
|
version = ProcessUtilities.outputExecutioner(command)
|
||||||
|
|
||||||
|
|
||||||
data_ret = {'status': 1, 'error_message': 'None'}
|
data_ret = {'status': 1, 'error_message': 'None'}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
|
|||||||
Reference in New Issue
Block a user