mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
Merge branch 'v2.3.2-dev' of https://github.com/usmannasir/cyberpanel into v2.3.2-dev
This commit is contained in:
@@ -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