mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-06-27 07:59:02 +02:00
Merge branch 'v2.3.2-dev' of https://github.com/usmannasir/cyberpanel into v2.3.2-dev
This commit is contained in:
@@ -551,20 +551,26 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
||||
|
||||
$scope.wordpresshomeloading = false;
|
||||
|
||||
var settingValue = 0;
|
||||
|
||||
if ($('#' + setting).is(":checked")) {
|
||||
settingValue = 1;
|
||||
}
|
||||
|
||||
var url = "/websites/UpdateWPSettings";
|
||||
|
||||
var data = {
|
||||
WPid: $('#WPid').html(),
|
||||
setting: setting,
|
||||
settingValue: settingValue
|
||||
|
||||
|
||||
if (setting === "PasswordProtection") {
|
||||
var data = {
|
||||
WPid: $('#WPid').html(),
|
||||
setting: setting,
|
||||
PPUsername: $scope.PPUsername,
|
||||
PPPassword: $scope.PPPassword,
|
||||
}
|
||||
} else {
|
||||
var settingValue = 0;
|
||||
if ($('#' + setting).is(":checked")) {
|
||||
settingValue = 1;
|
||||
}
|
||||
var data = {
|
||||
WPid: $('#WPid').html(),
|
||||
setting: setting,
|
||||
settingValue: settingValue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1595,7 +1601,8 @@ app.controller('RestoreWPBackup', function ($scope, $http, $timeout, $window) {
|
||||
// if (d == -1 || c == "") {
|
||||
// alert("Please Select Method of Backup Restore");
|
||||
// } else {
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@@ -135,8 +135,7 @@
|
||||
<div class="col-md-3">
|
||||
<h6 style="font-weight: bold">Password Protection</h6>
|
||||
<div class="custom-control custom-switch">
|
||||
<input
|
||||
type="radio" data-toggle="modal"
|
||||
<input type="radio" data-toggle="modal"
|
||||
data-target="#Passwordprotection"
|
||||
class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"
|
||||
id="passwdprotection">
|
||||
@@ -165,13 +164,13 @@
|
||||
|
||||
<div>
|
||||
<label class="col-sm-4">Username</label>
|
||||
<input required class="col-lg-8"
|
||||
<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 required class="col-lg-8"
|
||||
<input ng-model="$parent.PPPassword" required class="col-lg-8"
|
||||
type="password" placeholder="*******************">
|
||||
|
||||
</div>
|
||||
@@ -179,7 +178,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary"
|
||||
ng-click="FiPasswordprotection()">Yes
|
||||
ng-click="UpdateWPSettings('PasswordProtection')">Yes
|
||||
</button>
|
||||
<button type="button" ng-disabled="savingSettings"
|
||||
class="btn btn-default" data-dismiss="modal">
|
||||
|
||||
@@ -1191,7 +1191,13 @@ class WebsiteManager:
|
||||
|
||||
WPManagerID = data['WPid']
|
||||
setting = data['setting']
|
||||
settingValue = data['settingValue']
|
||||
|
||||
if setting == 'PasswordProtection':
|
||||
PPUsername = data['PPUsername']
|
||||
PPPassword = data['PPPassword']
|
||||
else:
|
||||
settingValue = data['settingValue']
|
||||
|
||||
wpsite = WPSites.objects.get(pk=WPManagerID)
|
||||
|
||||
if ACLManager.checkOwnership(wpsite.owner.domain, admin, currentACL) == 1:
|
||||
@@ -1264,7 +1270,6 @@ class WebsiteManager:
|
||||
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)
|
||||
stdoutput = ProcessUtilities.outputExecutioner(command)
|
||||
|
||||
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)
|
||||
@@ -1279,6 +1284,11 @@ class WebsiteManager:
|
||||
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)
|
||||
stdoutput = ProcessUtilities.outputExecutioner(command)
|
||||
elif setting == 'PasswordProtection':
|
||||
execPath = f"/usr/local/CyberCP/bin/python {virtualHostUtilities.cyberPanel}/plogical/virtualHostUtilities.py"
|
||||
execPath = f"{execPath} EnableDisablePP --username '{PPUsername}' --password '{PPPassword}' --virtualHostName {Webobj.domain} --path {path}"
|
||||
ProcessUtilities.executioner(execPath)
|
||||
|
||||
|
||||
data_ret = {'status': 1, 'error_message': 'None'}
|
||||
json_data = json.dumps(data_ret)
|
||||
|
||||
Reference in New Issue
Block a user