mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
bug fix: wp manager ref https://app.clickup.com/t/86enk2tcy
This commit is contained in:
@@ -3,18 +3,20 @@ import json
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sys.path.append('/usr/local/CyberCP')
|
sys.path.append('/usr/local/CyberCP')
|
||||||
import django
|
|
||||||
|
try:
|
||||||
|
import django
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from plogical import randomPassword
|
from plogical import randomPassword
|
||||||
from plogical.acl import ACLManager
|
from plogical.acl import ACLManager
|
||||||
|
from dockerManager.dockerInstall import DockerInstall
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
from dockerManager.dockerInstall import DockerInstall
|
|
||||||
from plogical.processUtilities import ProcessUtilities
|
from plogical.processUtilities import ProcessUtilities
|
||||||
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||||
import argparse
|
import argparse
|
||||||
|
|||||||
@@ -791,7 +791,6 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form>
|
<form>
|
||||||
|
|
||||||
|
|
||||||
<h4 style="margin: 2%">Configure setting for automatic
|
<h4 style="margin: 2%">Configure setting for automatic
|
||||||
updates.</h4>
|
updates.</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -803,7 +802,7 @@
|
|||||||
style="padding: 10px">
|
style="padding: 10px">
|
||||||
<option>Disabled</option>
|
<option>Disabled</option>
|
||||||
<option>Minor and Security Updates</option>
|
<option>Minor and Security Updates</option>
|
||||||
<option>All (minor and major)</option>
|
<option>All minor and major</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1076,6 +1076,29 @@ class WebsiteManager:
|
|||||||
else:
|
else:
|
||||||
return ACLManager.loadError()
|
return ACLManager.loadError()
|
||||||
|
|
||||||
|
|
||||||
|
php = PHPManager.getPHPString(wpsite.owner.phpSelection)
|
||||||
|
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
|
||||||
|
|
||||||
|
if AutomaticUpdates == 'Disabled':
|
||||||
|
command = f"{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE false --raw --allow-root --path=" + wpsite.path
|
||||||
|
result = ProcessUtilities.outputExecutioner(command, wpsite.owner.externalApp)
|
||||||
|
|
||||||
|
if result.find('Success:') == -1:
|
||||||
|
raise BaseException(result)
|
||||||
|
elif AutomaticUpdates == 'Minor and Security Updates':
|
||||||
|
command = f"{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE minor --allow-root --path=" + wpsite.path
|
||||||
|
result = ProcessUtilities.outputExecutioner(command, wpsite.owner.externalApp)
|
||||||
|
|
||||||
|
if result.find('Success:') == -1:
|
||||||
|
raise BaseException(result)
|
||||||
|
else:
|
||||||
|
command = f"{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE true --raw --allow-root --path=" + wpsite.path
|
||||||
|
result = ProcessUtilities.outputExecutioner(command, wpsite.owner.externalApp)
|
||||||
|
|
||||||
|
if result.find('Success:') == -1:
|
||||||
|
raise BaseException(result)
|
||||||
|
|
||||||
wpsite.AutoUpdates = AutomaticUpdates
|
wpsite.AutoUpdates = AutomaticUpdates
|
||||||
wpsite.PluginUpdates = Plugins
|
wpsite.PluginUpdates = Plugins
|
||||||
wpsite.ThemeUpdates = Themes
|
wpsite.ThemeUpdates = Themes
|
||||||
|
|||||||
Reference in New Issue
Block a user