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
|
||||||
import pysftp as sftp
|
import pysftp as sftp
|
||||||
import boto3
|
import boto3
|
||||||
|
|
||||||
if os.path.exists(ProcessUtilities.debugPath):
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
logging.writeToFile("Restore WP backup Now ....... start:%s" % self.extraArgs['Domain'])
|
logging.writeToFile("Restore WP backup Now ....... start:%s" % self.extraArgs['Domain'])
|
||||||
|
|
||||||
@@ -2979,7 +2980,11 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
DatabaseNameold = config['DatabaseName']
|
DatabaseNameold = config['DatabaseName']
|
||||||
DumpFileName = DatabaseNameold + ".sql"
|
DumpFileName = DatabaseNameold + ".sql"
|
||||||
oldurl = config['WPFinalURL']
|
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
|
packegs = packgobj.packageName
|
||||||
WebOwnerobj = Administrator.objects.get(pk=config['Webadmin_id'])
|
WebOwnerobj = Administrator.objects.get(pk=config['Webadmin_id'])
|
||||||
WebOwner = WebOwnerobj.userName
|
WebOwner = WebOwnerobj.userName
|
||||||
@@ -6184,8 +6189,6 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
logging.statusWriter(self.tempStatusPath, 'Restoring site ....,30')
|
logging.statusWriter(self.tempStatusPath, 'Restoring site ....,30')
|
||||||
NewWPsite = WPSites.objects.get(FinalURL=newurl)
|
NewWPsite = WPSites.objects.get(FinalURL=newurl)
|
||||||
VHuser = NewWPsite.owner.externalApp
|
VHuser = NewWPsite.owner.externalApp
|
||||||
|
|||||||
@@ -236,10 +236,10 @@ class phpUtilities:
|
|||||||
finalConfPath = ApacheVhost.configBasePath + domainName + '.conf'
|
finalConfPath = ApacheVhost.configBasePath + domainName + '.conf'
|
||||||
if os.path.exists(finalConfPath):
|
if os.path.exists(finalConfPath):
|
||||||
command = f'grep -Eo -m 1 "php[0-9]+" {finalConfPath} | sed -n "1p"'
|
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
|
# Input string
|
||||||
php_version = "php73"
|
#php_version = "php73"
|
||||||
|
|
||||||
# Insert a period between '7' and '3' to convert it to 'php7.3'
|
# Insert a period between '7' and '3' to convert it to 'php7.3'
|
||||||
converted_version = php_version[:4] + '.' + php_version[4:]
|
converted_version = php_version[:4] + '.' + php_version[4:]
|
||||||
@@ -277,7 +277,8 @@ class phpUtilities:
|
|||||||
logging.CyberCPLogFileWriter.writeToFile(result)
|
logging.CyberCPLogFileWriter.writeToFile(result)
|
||||||
|
|
||||||
command = result + " -v 2>/dev/null | awk '/^PHP/ {print $2}'"
|
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}"
|
return f"PHP {php_version}"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ class sslUtilities:
|
|||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
return [0, "347 " + str(msg) + " [issueSSLForDomain]"]
|
return [0, "347 " + str(msg) + " [issueSSLForDomain]"]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def PatchVhostConf(virtualHostName):
|
def PatchVhostConf(virtualHostName):
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
strr='8.0.30'
|
||||||
|
|
||||||
|
print(strr[:3])
|
||||||
Reference in New Issue
Block a user