mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +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 sys
|
||||
import time
|
||||
|
||||
|
||||
|
||||
sys.path.append('/usr/local/CyberCP')
|
||||
import django
|
||||
|
||||
try:
|
||||
import django
|
||||
except:
|
||||
pass
|
||||
|
||||
try:
|
||||
from plogical import randomPassword
|
||||
from plogical.acl import ACLManager
|
||||
from dockerManager.dockerInstall import DockerInstall
|
||||
except:
|
||||
pass
|
||||
from dockerManager.dockerInstall import DockerInstall
|
||||
|
||||
from plogical.processUtilities import ProcessUtilities
|
||||
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||
import argparse
|
||||
|
||||
@@ -791,7 +791,6 @@
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
|
||||
|
||||
<h4 style="margin: 2%">Configure setting for automatic
|
||||
updates.</h4>
|
||||
<div class="row">
|
||||
@@ -803,7 +802,7 @@
|
||||
style="padding: 10px">
|
||||
<option>Disabled</option>
|
||||
<option>Minor and Security Updates</option>
|
||||
<option>All (minor and major)</option>
|
||||
<option>All minor and major</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1076,6 +1076,29 @@ class WebsiteManager:
|
||||
else:
|
||||
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.PluginUpdates = Plugins
|
||||
wpsite.ThemeUpdates = Themes
|
||||
|
||||
Reference in New Issue
Block a user