diff --git a/plogical/applicationInstaller.py b/plogical/applicationInstaller.py index 6e0ff0256..b48b91ef4 100755 --- a/plogical/applicationInstaller.py +++ b/plogical/applicationInstaller.py @@ -2652,18 +2652,6 @@ $parameters = array( newWPpath = wpsite.path newurl = wpsite.FinalURL - #### Check If sub dir in web site - try: - oldpath = config['WPsitepath'] - abc = oldpath.split("/") - pathexta = abc[4] - if pathexta != "": - home = "0" - else: - home = "1" - except BaseException as msg: - home = "1" - ### get WPsite Database name and usr php = PHPManager.getPHPString(PhpVersion) FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) @@ -2802,20 +2790,38 @@ $parameters = array( logging.statusWriter(self.tempStatusPath, 'Copying Data File...,50') ###Copy backup content to newsite if home == "0": + #### Check If sub dir in New web site + try: + kl = newWPpath.split("/") + newpathexta = kl[4] + if newpathexta != "": + newsubdir = "0" + else: + newsubdir = "1" + except BaseException as msg: + newsubdir = "1" + + if newsubdir == "0": + unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath) + ###first split back to publich_html then mak dir and te copy + b = newWPpath.rstrip('/') + newwebpath = b.rstrip(newpathexta) + command = "sudo -u %s mkdir %s%s" % (VHuser, newwebpath, pathexta) + ProcessUtilities.executioner(command) + Webnewpath = str(newwebpath) + str(pathexta) + + else: + unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath) + ###make dir of sub folder in existing site + command = "sudo -u %s mkdir %s%s" % (VHuser, newWPpath, pathexta) + ProcessUtilities.executioner(command) + Webnewpath = str(newWPpath) + str(pathexta) + + else: unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath) - ###make dir of sub folder in existing site - command = "sudo -u %s mkdir %s%s" % (VHuser, newWPpath, pathexta) - ProcessUtilities.executioner(command) - Webnewpath = str(newWPpath) + str(pathexta) - else: - unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % ( - self.tempPath, oldtemppath) Webnewpath = newWPpath - ###/usr/local/CyberCP/tmp/1755/ab/usr/local/CyberCP/tmp/8774/public_html - ###/usr/local/CyberCP/tmp/1755/ab/usr/local/CyberCP/tmp/8774/public_html/public_html/* - command = "sudo -u %s cp -R %s* %s" % (VHuser, unzippath, Webnewpath) result = ProcessUtilities.outputExecutioner(command) @@ -2975,7 +2981,7 @@ $parameters = array( newurl = wpsite.FinalURL - #### Check If sub dir in web site + #### Check If sub dir in old web site try: oldpath = config['WPsitepath'] abc = oldpath.split("/") @@ -2987,6 +2993,9 @@ $parameters = array( except BaseException as msg: home = "1" + + + ### get WPsite Database name and usr php = PHPManager.getPHPString(PhpVersion) FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) @@ -3039,14 +3048,35 @@ $parameters = array( logging.statusWriter(self.tempStatusPath, 'Copying Data File...,50') ###Copy backup content to newsite if home == "0": + #### Check If sub dir in New web site + try: + kl = newWPpath.split("/") + newpathexta = kl[4] + if newpathexta != "": + newsubdir = "0" + else: + newsubdir = "1" + except BaseException as msg: + newsubdir = "1" + + if newsubdir == "0": + unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath) + ###first split back to publich_html then mak dir and te copy + b = newWPpath.rstrip('/') + newwebpath = b.rstrip(newpathexta) + command = "sudo -u %s mkdir %s%s" % (VHuser, newwebpath, pathexta) + ProcessUtilities.executioner(command) + Webnewpath = str(newwebpath) + str(pathexta) + + else: + unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath) + ###make dir of sub folder in existing site + command = "sudo -u %s mkdir %s%s" % (VHuser, newWPpath, pathexta) + ProcessUtilities.executioner(command) + Webnewpath = str(newWPpath) + str(pathexta) - unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath) - ###make dir of sub folder in existing site - command = "sudo -u %s mkdir %s%s"%(VHuser, newWPpath, pathexta) - ProcessUtilities.executioner(command) - Webnewpath = str(newWPpath)+str(pathexta) else: - ##usr/local/CyberCP/tmp/4701/ab/usr/local/CyberCP/tmp/9507/public_html/public_html/ + unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath) Webnewpath = newWPpath diff --git a/websiteFunctions/templates/websiteFunctions/RestoreBackups.html b/websiteFunctions/templates/websiteFunctions/RestoreBackups.html index dc510353e..c90bd0e86 100644 --- a/websiteFunctions/templates/websiteFunctions/RestoreBackups.html +++ b/websiteFunctions/templates/websiteFunctions/RestoreBackups.html @@ -114,9 +114,9 @@
{{ sub.id }}
- +{% trans "On this page you can Restore, list, modify and delete Backups Wordpress Sites from your server." %}
+ +