mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
bug fix: shift to default package if package not exists on wp restore backup
This commit is contained in:
@@ -2960,6 +2960,7 @@ class ApplicationInstaller(multi.Thread):
|
||||
import pysftp
|
||||
import pysftp as sftp
|
||||
import boto3
|
||||
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.writeToFile("Restore WP backup Now ....... start:%s" % self.extraArgs['Domain'])
|
||||
|
||||
@@ -2979,7 +2980,11 @@ class ApplicationInstaller(multi.Thread):
|
||||
DatabaseNameold = config['DatabaseName']
|
||||
DumpFileName = DatabaseNameold + ".sql"
|
||||
oldurl = config['WPFinalURL']
|
||||
packgobj = Package.objects.get(pk=config['Webpackage_id'])
|
||||
try:
|
||||
packgobj = Package.objects.get(pk=config['Webpackage_id'])
|
||||
except:
|
||||
packgobj = Package.objects.get(packageName='Default')
|
||||
|
||||
packegs = packgobj.packageName
|
||||
WebOwnerobj = Administrator.objects.get(pk=config['Webadmin_id'])
|
||||
WebOwner = WebOwnerobj.userName
|
||||
@@ -6184,8 +6189,6 @@ class ApplicationInstaller(multi.Thread):
|
||||
time.sleep(2)
|
||||
|
||||
|
||||
|
||||
|
||||
logging.statusWriter(self.tempStatusPath, 'Restoring site ....,30')
|
||||
NewWPsite = WPSites.objects.get(FinalURL=newurl)
|
||||
VHuser = NewWPsite.owner.externalApp
|
||||
|
||||
@@ -236,10 +236,10 @@ class phpUtilities:
|
||||
finalConfPath = ApacheVhost.configBasePath + domainName + '.conf'
|
||||
if os.path.exists(finalConfPath):
|
||||
command = f'grep -Eo -m 1 "php[0-9]+" {finalConfPath} | sed -n "1p"'
|
||||
result = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
|
||||
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
|
||||
|
||||
# Input string
|
||||
php_version = "php73"
|
||||
#php_version = "php73"
|
||||
|
||||
# Insert a period between '7' and '3' to convert it to 'php7.3'
|
||||
converted_version = php_version[:4] + '.' + php_version[4:]
|
||||
@@ -277,7 +277,8 @@ class phpUtilities:
|
||||
logging.CyberCPLogFileWriter.writeToFile(result)
|
||||
|
||||
command = result + " -v 2>/dev/null | awk '/^PHP/ {print $2}'"
|
||||
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')
|
||||
php_version = ProcessUtilities.outputExecutioner(command, None, True).rstrip('\n')[:3]
|
||||
|
||||
return f"PHP {php_version}"
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -165,6 +165,7 @@ class sslUtilities:
|
||||
|
||||
except BaseException as msg:
|
||||
return [0, "347 " + str(msg) + " [issueSSLForDomain]"]
|
||||
|
||||
@staticmethod
|
||||
def PatchVhostConf(virtualHostName):
|
||||
try:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
strr='8.0.30'
|
||||
|
||||
print(strr[:3])
|
||||
Reference in New Issue
Block a user