backuprestore0.2

This commit is contained in:
Hassan Hashmi
2022-06-13 13:47:44 +05:00
parent ffd8bf7c21
commit a59e02fb30
5 changed files with 884 additions and 648 deletions

View File

@@ -2263,12 +2263,13 @@ $parameters = array(
try: try:
from managePHP.phpManager import PHPManager from managePHP.phpManager import PHPManager
import json import json
logging.writeToFile("WPCreateBackup ....... start" )
self.tempStatusPath = self.extraArgs['tempStatusPath'] self.tempStatusPath = self.extraArgs['tempStatusPath']
logging.statusWriter(self.tempStatusPath, 'Creating BackUp...,10') logging.statusWriter(self.tempStatusPath, 'Creating BackUp...,10')
wpsite = WPSites.objects.get(pk=self.extraArgs['WPid']) wpsite = WPSites.objects.get(pk=self.extraArgs['WPid'])
Adminobj = Administrator.objects.get(pk=self.extraArgs['adminID']) Adminobj = Administrator.objects.get(pk=self.extraArgs['adminID'])
Backuptype = self.extraArgs['Backuptype']
website = wpsite.owner website = wpsite.owner
PhpVersion = website.phpSelection PhpVersion = website.phpSelection
@@ -2280,129 +2281,328 @@ $parameters = array(
php = PHPManager.getPHPString(PhpVersion) php = PHPManager.getPHPString(PhpVersion)
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
if Backuptype == "1":
logging.statusWriter(self.tempStatusPath, 'Getting database...,20') logging.statusWriter(self.tempStatusPath, 'Getting database...,20')
command = f'{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path={WPsitepath}' command = f'{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path={WPsitepath}'
stdoutput = ProcessUtilities.outputExecutioner(command, VHuser) stdoutput = ProcessUtilities.outputExecutioner(command, VHuser)
DataBaseName = stdoutput.rstrip("\n") DataBaseName = stdoutput.rstrip("\n")
command = f'{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path={WPsitepath}' command = f'{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path={WPsitepath}'
stdoutput = ProcessUtilities.outputExecutioner(command,VHuser) stdoutput = ProcessUtilities.outputExecutioner(command,VHuser)
DataBaseUser = stdoutput.rstrip("\n") DataBaseUser = stdoutput.rstrip("\n")
### Create secure folder ### Create secure folder
ACLManager.CreateSecureDir() ACLManager.CreateSecureDir()
RandomPath = str(randint(1000, 9999)) RandomPath = str(randint(1000, 9999))
self.tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', RandomPath) self.tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', RandomPath)
command = f'mkdir -p {self.tempPath}' command = f'mkdir -p {self.tempPath}'
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
command = f'chown -R {wpsite.owner.externalApp}:{wpsite.owner.externalApp} {self.tempPath}' command = f'chown -R {wpsite.owner.externalApp}:{wpsite.owner.externalApp} {self.tempPath}'
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
### Make directory for backup ### Make directory for backup
logging.statusWriter(self.tempStatusPath, 'Creating Backup Directory...,40') logging.statusWriter(self.tempStatusPath, 'Creating Backup Directory...,40')
command = f"mkdir -p {self.tempPath}/public_html" command = f"mkdir -p {self.tempPath}/public_html"
ProcessUtilities.executioner(command, VHuser) ProcessUtilities.executioner(command, VHuser)
config = {} config = {}
config['WPtitle']=wpsite.title config['WPtitle']=wpsite.title
config['WPAutoUpdates']=wpsite.AutoUpdates config['WPAutoUpdates']=wpsite.AutoUpdates
config['WPFinalURL']=wpsite.FinalURL config['WPFinalURL']=wpsite.FinalURL
config['WPPluginUpdates']=wpsite.PluginUpdates config['WPPluginUpdates']=wpsite.PluginUpdates
config['WPThemeUpdates']=wpsite.ThemeUpdates config['WPThemeUpdates']=wpsite.ThemeUpdates
config['WPowner_id']=wpsite.owner_id config['WPowner_id']=wpsite.owner_id
config["WPsitepath"] = wpsite.path config["WPsitepath"] = wpsite.path
config["DatabaseName"] = DataBaseName config["DatabaseName"] = DataBaseName
config["DatabaseUser"] = DataBaseUser config["DatabaseUser"] = DataBaseUser
config['RandomPath'] = RandomPath config['RandomPath'] = RandomPath
config["WebDomain"] = websitedomain config["WebDomain"] = websitedomain
config['WebadminEmail'] = website.adminEmail config['WebadminEmail'] = website.adminEmail
config['WebphpSelection'] = website.phpSelection config['WebphpSelection'] = website.phpSelection
config['Webssl'] = website.ssl config['Webssl'] = website.ssl
config['Webstate'] = website.state config['Webstate'] = website.state
config['WebVHuser'] = website.externalApp config['WebVHuser'] = website.externalApp
config['Webpackage_id'] = website.package_id config['Webpackage_id'] = website.package_id
config['Webadmin_id'] = website.admin_id config['Webadmin_id'] = website.admin_id
config['name'] = 'backup-' + websitedomain + "-" + time.strftime("%m.%d.%Y_%H-%M-%S") config['name'] = 'backup-' + websitedomain + "-" + time.strftime("%m.%d.%Y_%H-%M-%S")
config['Backuptype'] = "Both Website and DataBase"
###############Create config.Json file
#command = "sudo -u %s touch /home/cyberpanel/config.json" % (VHuser)
#ProcessUtilities.executioner(command)
###### write into config
json_object = json.dumps(config, indent=4)
configPath = "/home/cyberpanel/" + str(randint(1000, 9999))
file = open(configPath, "w")
file.write(json_object)
file.close()
###############Create config.Json file os.chmod(configPath, 0o600)
#command = "sudo -u %s touch /home/cyberpanel/config.json" % (VHuser)
#ProcessUtilities.executioner(command)
###### write into config
json_object = json.dumps(config, indent=4)
configPath = "/home/cyberpanel/" + str(randint(1000, 9999))
file = open(configPath, "w")
file.write(json_object)
file.close()
os.chmod(configPath, 0o600) command = f"cp -R {configPath} {self.tempPath}"
ProcessUtilities.executioner(command, VHuser)
command = f"cp -R {configPath} {self.tempPath}" command = f"rm -r {configPath}"
ProcessUtilities.executioner(command, VHuser) ProcessUtilities.executioner(command)
command = f"rm -r {configPath}" logging.statusWriter(self.tempStatusPath, 'Copying website data.....,50')
ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Copying website data.....,50') ############## Copy Public_htnl to backup
command = "sudo -u %s cp -R %s* %s/public_html" % (VHuser, WPsitepath, self.tempPath)
result = ProcessUtilities.outputExecutioner(command)
############## Copy Public_htnl to backup if os.path.exists(ProcessUtilities.debugPath):
command = "sudo -u %s cp -R %s* %s/public_html" % (VHuser, WPsitepath, self.tempPath) logging.writeToFile(result)
result = ProcessUtilities.outputExecutioner(command)
if os.path.exists(ProcessUtilities.debugPath): command = "sudo -u %s cp -R %s.[^.]* %s/public_html/" % (VHuser, WPsitepath, self.tempPath)
logging.writeToFile(result) result = ProcessUtilities.outputExecutioner(command)
command = "sudo -u %s cp -R %s.[^.]* %s/public_html/" % (VHuser, WPsitepath, self.tempPath) if os.path.exists(ProcessUtilities.debugPath):
result = ProcessUtilities.outputExecutioner(command) logging.writeToFile(result)
if os.path.exists(ProcessUtilities.debugPath): logging.statusWriter(self.tempStatusPath, 'Copying DataBase.....,70')
logging.writeToFile(result)
logging.statusWriter(self.tempStatusPath, 'Copying DataBase.....,70')
##### SQLDUMP database into new directory ##### SQLDUMP database into new directory
command = "mysqldump %s --result-file %s/%s.sql" % (DataBaseName, self.tempPath, DataBaseName) command = "mysqldump %s --result-file %s/%s.sql" % (DataBaseName, self.tempPath, DataBaseName)
result = ProcessUtilities.outputExecutioner(command) result = ProcessUtilities.outputExecutioner(command)
if os.path.exists(ProcessUtilities.debugPath): if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(result) logging.writeToFile(result)
######## Zip backup directory ######## Zip backup directory
logging.statusWriter(self.tempStatusPath, 'Compressing backup files.....,80') logging.statusWriter(self.tempStatusPath, 'Compressing backup files.....,80')
websitepath = "/home/%s"%websitedomain websitepath = "/home/%s"%websitedomain
FinalZipPath = '%s/%s.zip' % (websitepath, RandomPath) FinalZipPath = '%s/%s.zip' % (websitepath, RandomPath)
command = 'mkdir -p /home/backup/' command = 'mkdir -p /home/backup/'
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
command = f"tar -czvf /home/backup/{config['name']}.tar.gz -P {self.tempPath}" command = f"tar -czvf /home/backup/{config['name']}.tar.gz -P {self.tempPath}"
result = ProcessUtilities.outputExecutioner(command) result = ProcessUtilities.outputExecutioner(command)
backupobj = WPSitesBackup(owner=Adminobj, WPSiteID=wpsite.id, WebsiteID=website.id, config=json_object) backupobj = WPSitesBackup(owner=Adminobj, WPSiteID=wpsite.id, WebsiteID=website.id, config=json_object)
backupobj.save() backupobj.save()
if os.path.exists(ProcessUtilities.debugPath): if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(result) logging.writeToFile(result)
command = f'rm -rf {self.tempPath}' command = f'rm -rf {self.tempPath}'
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Completed.[200]') logging.statusWriter(self.tempStatusPath, 'Completed.[200]')
return 1, f"/home/backup/{config['name']}.tar.gz" return 1, f"/home/backup/{config['name']}.tar.gz"
elif Backuptype == "2":
###Onlye website data
### Create secure folder
ACLManager.CreateSecureDir()
RandomPath = str(randint(1000, 9999))
self.tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', RandomPath)
command = f'mkdir -p {self.tempPath}'
ProcessUtilities.executioner(command)
command = f'chown -R {wpsite.owner.externalApp}:{wpsite.owner.externalApp} {self.tempPath}'
ProcessUtilities.executioner(command)
### Make directory for backup
logging.statusWriter(self.tempStatusPath, 'Creating Backup Directory...,40')
command = f"mkdir -p {self.tempPath}/public_html"
ProcessUtilities.executioner(command, VHuser)
config = {}
config['WPtitle'] = wpsite.title
config['WPAutoUpdates'] = wpsite.AutoUpdates
config['WPFinalURL'] = wpsite.FinalURL
config['WPPluginUpdates'] = wpsite.PluginUpdates
config['WPThemeUpdates'] = wpsite.ThemeUpdates
config['WPowner_id'] = wpsite.owner_id
config["WPsitepath"] = wpsite.path
config["DatabaseName"] = "Not availabe"
config["DatabaseUser"] = "Not availabe"
config['RandomPath'] = RandomPath
config["WebDomain"] = websitedomain
config['WebadminEmail'] = website.adminEmail
config['WebphpSelection'] = website.phpSelection
config['Webssl'] = website.ssl
config['Webstate'] = website.state
config['WebVHuser'] = website.externalApp
config['Webpackage_id'] = website.package_id
config['Webadmin_id'] = website.admin_id
config['name'] = 'backup-' + websitedomain + "-" + time.strftime("%m.%d.%Y_%H-%M-%S")
config['Backuptype'] = "Website Backup"
###############Create config.Json file
# command = "sudo -u %s touch /home/cyberpanel/config.json" % (VHuser)
# ProcessUtilities.executioner(command)
###### write into config
json_object = json.dumps(config, indent=4)
configPath = "/home/cyberpanel/" + str(randint(1000, 9999))
file = open(configPath, "w")
file.write(json_object)
file.close()
os.chmod(configPath, 0o600)
command = f"cp -R {configPath} {self.tempPath}"
ProcessUtilities.executioner(command, VHuser)
command = f"rm -r {configPath}"
ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Copying website data.....,50')
############## Copy Public_htnl to backup
command = "sudo -u %s cp -R %s* %s/public_html" % (VHuser, WPsitepath, self.tempPath)
result = ProcessUtilities.outputExecutioner(command)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(result)
command = "sudo -u %s cp -R %s.[^.]* %s/public_html/" % (VHuser, WPsitepath, self.tempPath)
result = ProcessUtilities.outputExecutioner(command)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(result)
######## Zip backup directory
logging.statusWriter(self.tempStatusPath, 'Compressing backup files.....,80')
websitepath = "/home/%s" % websitedomain
FinalZipPath = '%s/%s.zip' % (websitepath, RandomPath)
command = 'mkdir -p /home/backup/'
ProcessUtilities.executioner(command)
command = f"tar -czvf /home/backup/{config['name']}.tar.gz -P {self.tempPath}"
result = ProcessUtilities.outputExecutioner(command)
backupobj = WPSitesBackup(owner=Adminobj, WPSiteID=wpsite.id, WebsiteID=website.id,
config=json_object)
backupobj.save()
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(result)
command = f'rm -rf {self.tempPath}'
ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Completed.[200]')
return 1, f"/home/backup/{config['name']}.tar.gz"
else:
###only backup of data base
logging.statusWriter(self.tempStatusPath, 'Getting database...,20')
command = f'{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path={WPsitepath}'
stdoutput = ProcessUtilities.outputExecutioner(command, VHuser)
DataBaseName = stdoutput.rstrip("\n")
command = f'{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path={WPsitepath}'
stdoutput = ProcessUtilities.outputExecutioner(command, VHuser)
DataBaseUser = stdoutput.rstrip("\n")
### Create secure folder
ACLManager.CreateSecureDir()
RandomPath = str(randint(1000, 9999))
self.tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', RandomPath)
command = f'mkdir -p {self.tempPath}'
ProcessUtilities.executioner(command)
command = f'chown -R {wpsite.owner.externalApp}:{wpsite.owner.externalApp} {self.tempPath}'
ProcessUtilities.executioner(command)
### Make directory for backup
logging.statusWriter(self.tempStatusPath, 'Creating Backup Directory...,40')
config = {}
config['WPtitle'] = wpsite.title
config['WPAutoUpdates'] = wpsite.AutoUpdates
config['WPFinalURL'] = wpsite.FinalURL
config['WPPluginUpdates'] = wpsite.PluginUpdates
config['WPThemeUpdates'] = wpsite.ThemeUpdates
config['WPowner_id'] = wpsite.owner_id
config["WPsitepath"] = wpsite.path
config["DatabaseName"] = DataBaseName
config["DatabaseUser"] = DataBaseUser
config['RandomPath'] = RandomPath
config["WebDomain"] = websitedomain
config['WebadminEmail'] = website.adminEmail
config['WebphpSelection'] = website.phpSelection
config['Webssl'] = website.ssl
config['Webstate'] = website.state
config['WebVHuser'] = website.externalApp
config['Webpackage_id'] = website.package_id
config['Webadmin_id'] = website.admin_id
config['name'] = 'backup-' + websitedomain + "-" + time.strftime("%m.%d.%Y_%H-%M-%S")
config['Backuptype'] = "DataBase Backup"
###############Create config.Json file
# command = "sudo -u %s touch /home/cyberpanel/config.json" % (VHuser)
# ProcessUtilities.executioner(command)
###### write into config
json_object = json.dumps(config, indent=4)
configPath = "/home/cyberpanel/" + str(randint(1000, 9999))
file = open(configPath, "w")
file.write(json_object)
file.close()
os.chmod(configPath, 0o600)
command = f"cp -R {configPath} {self.tempPath}"
ProcessUtilities.executioner(command, VHuser)
command = f"rm -r {configPath}"
ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Copying DataBase.....,70')
##### SQLDUMP database into new directory
command = "mysqldump %s --result-file %s/%s.sql" % (DataBaseName, self.tempPath, DataBaseName)
result = ProcessUtilities.outputExecutioner(command)
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(result)
######## Zip backup directory
logging.statusWriter(self.tempStatusPath, 'Compressing backup files.....,80')
websitepath = "/home/%s" % websitedomain
FinalZipPath = '%s/%s.zip' % (websitepath, RandomPath)
command = 'mkdir -p /home/backup/'
ProcessUtilities.executioner(command)
command = f"tar -czvf /home/backup/{config['name']}.tar.gz -P {self.tempPath}"
result = ProcessUtilities.outputExecutioner(command)
backupobj = WPSitesBackup(owner=Adminobj, WPSiteID=wpsite.id, WebsiteID=website.id, config=json_object)
backupobj.save()
if os.path.exists(ProcessUtilities.debugPath):
logging.writeToFile(result)
command = f'rm -rf {self.tempPath}'
ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Completed.[200]')
return 1, f"/home/backup/{config['name']}.tar.gz"
except BaseException as msg: except BaseException as msg:
logging.writeToFile("Error WPCreateBackup ....... %s" % str(msg)) logging.writeToFile("Error WPCreateBackup ....... %s" % str(msg))
@@ -2440,214 +2640,54 @@ $parameters = array(
WebOwnerobj = Administrator.objects.get(pk=config['Webadmin_id']) WebOwnerobj = Administrator.objects.get(pk=config['Webadmin_id'])
WebOwner = WebOwnerobj.userName WebOwner = WebOwnerobj.userName
#####Check Backup Type
BackupType = config['Backuptype']
if BackupType == 'DataBase Backup':
pass
elif BackupType == 'Website Backup':
pass
else:
#### Methode of Restoring
############## Existing site
if (DomainName == "" and int(self.extraArgs['DesSiteID']) != -1):
wpsite = WPSites.objects.get(pk=DesSiteID)
VHuser = wpsite.owner.externalApp
PhpVersion = wpsite.owner.phpSelection
newWPpath = wpsite.path
newurl = wpsite.FinalURL
#### Check If sub dir in web site
#### Methode of Restoring try:
############## Existing site oldpath = config['WPsitepath']
if (DomainName == "" and int(self.extraArgs['DesSiteID']) != -1): abc = oldpath.split("/")
wpsite = WPSites.objects.get(pk=DesSiteID) pathexta = abc[4]
VHuser = wpsite.owner.externalApp home = "0"
PhpVersion = wpsite.owner.phpSelection except BaseException as msg:
newWPpath = wpsite.path home = "1"
newurl = wpsite.FinalURL
#### Check If sub dir in web site
try:
abc = newWPpath.split("/")
newpath = abc[4]
home = "0"
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)
######Get DBname
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=%s' % (VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command)
Finaldbname = stdout.rstrip("\n")
######Get DBuser
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path=%s' % (VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command)
Finaldbuser = stdout.rstrip("\n")
#####Get DBpsswd
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_PASSWORD --skip-plugins --skip-themes --path=%s' % (VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command)
Finaldbpasswd = stdout.rstrip("\n")
### Create secure folder
ACLManager.CreateSecureDir()
RandomPath = str(randint(1000, 9999))
self.tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', RandomPath)
command = f'mkdir -p {self.tempPath}'
ProcessUtilities.executioner(command)
command = f'chown -R {wpsite.owner.externalApp}:{wpsite.owner.externalApp} {self.tempPath}'
ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Extracting Backup File...,30')
###First copy backup file to temp and then Unzip
command = "sudo -u %s cp -R /home/backup/%s* %s" % (VHuser, BackUpFileName, self.tempPath)
ProcessUtilities.executioner(command)
#### Make temp dir ab for unzip
command ="sudo -u %s mkdir %s/ab"%(VHuser,self.tempPath)
ProcessUtilities.executioner(command)
command = "sudo -u %s tar -xvf %s/%s.tar.gz -C %s/ab" % (VHuser, self.tempPath, BackUpFileName, self.tempPath)
ProcessUtilities.outputExecutioner(command)
###first empty the Existing site phblichtml folder
command = "sudo -u %s rm -r %s/*"%(VHuser, newWPpath)
result = ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Copying Data File...,50')
###Copy backup content to newsite
if home == "0":
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
else:
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/public_html/" % (self.tempPath, oldtemppath)
command = "sudo -u %s cp -R %s* %s" % (VHuser, unzippath, newWPpath)
result = ProcessUtilities.outputExecutioner(command)
#dump Mysql file in unzippath path
unzippath2 = "%s/ab/usr/local/CyberCP/tmp/%s/%s" % (self.tempPath, oldtemppath, DumpFileName)
command = "mysql -u root %s < %s" % (Finaldbname, unzippath2)
ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Restoreing Data Base...,70')
#####SetUp DataBase Settings
##set DBName
command = "sudo -u %s %s /usr/bin/wp config set DB_NAME %s --skip-plugins --skip-themes --path=%s" % (VHuser, FinalPHPPath, Finaldbname, newWPpath)
ProcessUtilities.outputExecutioner(command)
##set DBuser
command = "sudo -u %s %s /usr/bin/wp config set DB_USER %s --skip-plugins --skip-themes --path=%s" % (VHuser, FinalPHPPath, Finaldbuser, newWPpath)
ProcessUtilities.outputExecutioner(command)
##set DBpasswd
command = "sudo -u %s %s /usr/bin/wp config set DB_PASSWORD %s --skip-plugins --skip-themes --path=%s" % (VHuser, FinalPHPPath, Finaldbpasswd, newWPpath)
ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Replacing URLs...,90')
########Now Replace URL's
command = 'sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=%s "%s" "%s"' % (VHuser, newWPpath, oldurl, newurl)
ProcessUtilities.outputExecutioner(command)
command = 'sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "https://www.%s" "http://%s"' % (VHuser, newWPpath, newurl, newurl)
ProcessUtilities.outputExecutioner(command)
##Remove temppath
command = f'rm -rf {self.tempPath}'
ProcessUtilities.executioner(command)
###Restart Server
from plogical.installUtilities import installUtilities
installUtilities.reStartLiteSpeed()
############## New Site
elif(DomainName != "" and int(self.extraArgs['DesSiteID']) == -1):
###############Create New WordPressSite First
# logging.writeToFile("New Website Domain ....... %s" % str(DomainName))
DataToPass = {}
DataToPass['title'] = config['WPtitle']
DataToPass['domain'] = DomainName
DataToPass['WPVersion'] = "6.0"
DataToPass['adminUser'] = config['WebVHuser']
DataToPass['Email'] = config['WebadminEmail']
DataToPass['PasswordByPass'] = config['DatabaseUser']
DataToPass['AutomaticUpdates'] = config['WPAutoUpdates']
DataToPass['Plugins'] = config['WPPluginUpdates']
DataToPass['Themes'] = config['WPThemeUpdates']
DataToPass['websiteOwner'] = WebOwner
DataToPass['package'] = packegs
try:
oldpath = config['WPsitepath']
logging.writeToFile("old path..:%s"%oldpath)
abc = oldpath.split("/")
newpath = abc[4]
newurl = "%s/%s"%(DomainName,newpath)
home = "0"
except BaseException as msg:
logging.writeToFile("path error: %s"%msg)
newpath = ""
newurl = DomainName
home = "1"
DataToPass['path'] = newpath
DataToPass['home'] = home
try:
website = Websites.objects.get(domain=DomainName)
logging.statusWriter(self.tempStatusPath, 'Web Site Already Exist.[404]')
except:
ab = WebsiteManager()
coreResult = ab.submitWorpressCreation(userID, DataToPass)
coreResult1 = json.loads((coreResult).content)
logging.writeToFile("WP Creating website result....%s" % coreResult1)
reutrntempath = coreResult1['tempStatusPath']
while (1):
lastLine = open(reutrntempath, 'r').read()
logging.writeToFile("Error WP creating lastline ....... %s" % lastLine)
if lastLine.find('[200]') > -1:
break
elif lastLine.find('[404]') > -1:
logging.statusWriter(self.tempStatusPath, 'Failed to WordPress: error: %s. [404]'% lastLine)
return 0
else:
logging.statusWriter(self.tempStatusPath, 'Creating WordPress....,20')
time.sleep(2)
logging.statusWriter(self.tempStatusPath, 'Restoring site ....,30')
NewWPsite =WPSites.objects.get(FinalURL=newurl)
VHuser = NewWPsite.owner.externalApp
PhpVersion = NewWPsite.owner.phpSelection
newWPpath = NewWPsite.path
###### Same code already used in Existing site
### get WPsite Database name and usr ### get WPsite Database name and usr
php = PHPManager.getPHPString(PhpVersion) php = PHPManager.getPHPString(PhpVersion)
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php) FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
######Get DBname ######Get DBname
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=%s' % ( command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=%s' % (VHuser, FinalPHPPath, newWPpath)
VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command) stdout = ProcessUtilities.outputExecutioner(command)
Finaldbname = stdout.rstrip("\n") Finaldbname = stdout.rstrip("\n")
######Get DBuser ######Get DBuser
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path=%s' % ( command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path=%s' % (VHuser, FinalPHPPath, newWPpath)
VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command) stdout = ProcessUtilities.outputExecutioner(command)
Finaldbuser = stdout.rstrip("\n") Finaldbuser = stdout.rstrip("\n")
#####Get DBpsswd #####Get DBpsswd
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_PASSWORD --skip-plugins --skip-themes --path=%s' % ( command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_PASSWORD --skip-plugins --skip-themes --path=%s' % (VHuser, FinalPHPPath, newWPpath)
VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command) stdout = ProcessUtilities.outputExecutioner(command)
Finaldbpasswd = stdout.rstrip("\n") Finaldbpasswd = stdout.rstrip("\n")
### Create secure folder ### Create secure folder
ACLManager.CreateSecureDir() ACLManager.CreateSecureDir()
@@ -2657,70 +2697,73 @@ $parameters = array(
command = f'mkdir -p {self.tempPath}' command = f'mkdir -p {self.tempPath}'
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
command = f'chown -R {NewWPsite.owner.externalApp}:{NewWPsite.owner.externalApp} {self.tempPath}' command = f'chown -R {wpsite.owner.externalApp}:{wpsite.owner.externalApp} {self.tempPath}'
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Extracting Backup File...,40') logging.statusWriter(self.tempStatusPath, 'Extracting Backup File...,30')
###First copy backup file to temp and then Unzip ###First copy backup file to temp and then Unzip
command = "sudo -u %s cp -R /home/backup/%s* %s" % (VHuser, BackUpFileName, self.tempPath) command = "sudo -u %s cp -R /home/backup/%s* %s" % (VHuser, BackUpFileName, self.tempPath)
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
#### Make temp dir ab for unzip #### Make temp dir ab for unzip
command = "sudo -u %s mkdir %s/ab" % (VHuser, self.tempPath) command ="sudo -u %s mkdir %s/ab"%(VHuser,self.tempPath)
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
command = "sudo -u %s tar -xvf %s/%s.tar.gz -C %s/ab" % ( command = "sudo -u %s tar -xvf %s/%s.tar.gz -C %s/ab" % (VHuser, self.tempPath, BackUpFileName, self.tempPath)
VHuser, self.tempPath, BackUpFileName, self.tempPath)
ProcessUtilities.outputExecutioner(command) ProcessUtilities.outputExecutioner(command)
###first empty the Existing site phblichtml folder
command = "sudo -u %s rm -r %s/*" % (VHuser, newWPpath)
result = ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Copying Data File...,60')
logging.statusWriter(self.tempStatusPath, 'Copying Data File...,50')
###Copy backup content to newsite ###Copy backup content to newsite
if home == "0": if home == "0":
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath) 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: else:
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/public_html/" % (self.tempPath, oldtemppath) unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/public_html/" % (self.tempPath, oldtemppath)
Webnewpath = newWPpath
command = "sudo -u %s cp -R %s* %s" % (VHuser, unzippath, newWPpath)
command = "sudo -u %s cp -R %s* %s" % (VHuser, unzippath, Webnewpath)
result = ProcessUtilities.outputExecutioner(command) result = ProcessUtilities.outputExecutioner(command)
# dump Mysql file in unzippath path command = "sudo -u %s cp -R %s.[^.]* %s" % (VHuser, unzippath, Webnewpath)
result = ProcessUtilities.outputExecutioner(command)
#dump Mysql file in unzippath path
unzippath2 = "%s/ab/usr/local/CyberCP/tmp/%s/%s" % (self.tempPath, oldtemppath, DumpFileName) unzippath2 = "%s/ab/usr/local/CyberCP/tmp/%s/%s" % (self.tempPath, oldtemppath, DumpFileName)
command = "mysql -u root %s < %s" % (Finaldbname, unzippath2) command = "mysql -u root %s < %s" % (Finaldbname, unzippath2)
ProcessUtilities.outputExecutioner(command) ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Restoreing Data Base...,80') logging.statusWriter(self.tempStatusPath, 'Restoreing Data Base...,70')
#####SetUp DataBase Settings #####SetUp DataBase Settings
##set DBName ##set DBName
command = "sudo -u %s %s /usr/bin/wp config set DB_NAME %s --skip-plugins --skip-themes --path=%s" % ( command = "sudo -u %s %s /usr/bin/wp config set DB_NAME %s --skip-plugins --skip-themes --path=%s" % (VHuser, FinalPHPPath, Finaldbname, newWPpath)
VHuser, FinalPHPPath, Finaldbname, newWPpath)
ProcessUtilities.outputExecutioner(command) ProcessUtilities.outputExecutioner(command)
##set DBuser ##set DBuser
command = "sudo -u %s %s /usr/bin/wp config set DB_USER %s --skip-plugins --skip-themes --path=%s" % ( command = "sudo -u %s %s /usr/bin/wp config set DB_USER %s --skip-plugins --skip-themes --path=%s" % (VHuser, FinalPHPPath, Finaldbuser, newWPpath)
VHuser, FinalPHPPath, Finaldbuser, newWPpath)
ProcessUtilities.outputExecutioner(command) ProcessUtilities.outputExecutioner(command)
##set DBpasswd ##set DBpasswd
command = "sudo -u %s %s /usr/bin/wp config set DB_PASSWORD %s --skip-plugins --skip-themes --path=%s" % ( command = "sudo -u %s %s /usr/bin/wp config set DB_PASSWORD %s --skip-plugins --skip-themes --path=%s" % (VHuser, FinalPHPPath, Finaldbpasswd, newWPpath)
VHuser, FinalPHPPath, Finaldbpasswd, newWPpath)
ProcessUtilities.outputExecutioner(command) ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Replacing URLs...,90') logging.statusWriter(self.tempStatusPath, 'Replacing URLs...,90')
########Now Replace URL's ########Now Replace URL's
command = 'sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=%s "%s" "%s"' % ( command = 'sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=%s "%s" "%s"' % (VHuser, newWPpath, oldurl, newurl)
VHuser, newWPpath, oldurl, newurl)
ProcessUtilities.outputExecutioner(command) ProcessUtilities.outputExecutioner(command)
command = 'sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "https://www.%s" "http://%s"' % ( command = 'sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "https://www.%s" "http://%s"' % (VHuser, newWPpath, newurl, newurl)
VHuser, newWPpath, newurl, newurl)
ProcessUtilities.outputExecutioner(command) ProcessUtilities.outputExecutioner(command)
##Remove temppath # ##Remove temppath
command = f'rm -rf {self.tempPath}' command = f'rm -rf {self.tempPath}'
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
@@ -2728,6 +2771,172 @@ $parameters = array(
from plogical.installUtilities import installUtilities from plogical.installUtilities import installUtilities
installUtilities.reStartLiteSpeed() installUtilities.reStartLiteSpeed()
############## New Site
elif(DomainName != "" and int(self.extraArgs['DesSiteID']) == -1):
###############Create New WordPressSite First
# logging.writeToFile("New Website Domain ....... %s" % str(DomainName))
DataToPass = {}
DataToPass['title'] = config['WPtitle']
DataToPass['domain'] = DomainName
DataToPass['WPVersion'] = "6.0"
DataToPass['adminUser'] = config['WebVHuser']
DataToPass['Email'] = config['WebadminEmail']
DataToPass['PasswordByPass'] = config['DatabaseUser']
DataToPass['AutomaticUpdates'] = config['WPAutoUpdates']
DataToPass['Plugins'] = config['WPPluginUpdates']
DataToPass['Themes'] = config['WPThemeUpdates']
DataToPass['websiteOwner'] = WebOwner
DataToPass['package'] = packegs
try:
oldpath = config['WPsitepath']
abc = oldpath.split("/")
newpath = abc[4]
newurl = "%s/%s"%(DomainName,newpath)
home = "0"
except BaseException as msg:
newpath = ""
newurl = DomainName
home = "1"
DataToPass['path'] = newpath
DataToPass['home'] = home
try:
website = Websites.objects.get(domain=DomainName)
logging.statusWriter(self.tempStatusPath, 'Web Site Already Exist.[404]')
except:
ab = WebsiteManager()
coreResult = ab.submitWorpressCreation(userID, DataToPass)
coreResult1 = json.loads((coreResult).content)
logging.writeToFile("WP Creating website result....%s" % coreResult1)
reutrntempath = coreResult1['tempStatusPath']
while (1):
lastLine = open(reutrntempath, 'r').read()
logging.writeToFile("Error WP creating lastline ....... %s" % lastLine)
if lastLine.find('[200]') > -1:
break
elif lastLine.find('[404]') > -1:
logging.statusWriter(self.tempStatusPath, 'Failed to WordPress: error: %s. [404]'% lastLine)
return 0
else:
logging.statusWriter(self.tempStatusPath, 'Creating WordPress....,20')
time.sleep(2)
logging.statusWriter(self.tempStatusPath, 'Restoring site ....,30')
NewWPsite =WPSites.objects.get(FinalURL=newurl)
VHuser = NewWPsite.owner.externalApp
PhpVersion = NewWPsite.owner.phpSelection
newWPpath = NewWPsite.path
###### Same code already used in Existing site
### get WPsite Database name and usr
php = PHPManager.getPHPString(PhpVersion)
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
######Get DBname
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_NAME --skip-plugins --skip-themes --path=%s' % (
VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command)
Finaldbname = stdout.rstrip("\n")
######Get DBuser
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_USER --skip-plugins --skip-themes --path=%s' % (
VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command)
Finaldbuser = stdout.rstrip("\n")
#####Get DBpsswd
command = 'sudo -u %s %s -d error_reporting=0 /usr/bin/wp config get DB_PASSWORD --skip-plugins --skip-themes --path=%s' % (
VHuser, FinalPHPPath, newWPpath)
stdout = ProcessUtilities.outputExecutioner(command)
Finaldbpasswd = stdout.rstrip("\n")
### Create secure folder
ACLManager.CreateSecureDir()
RandomPath = str(randint(1000, 9999))
self.tempPath = '%s/%s' % ('/usr/local/CyberCP/tmp', RandomPath)
command = f'mkdir -p {self.tempPath}'
ProcessUtilities.executioner(command)
command = f'chown -R {NewWPsite.owner.externalApp}:{NewWPsite.owner.externalApp} {self.tempPath}'
ProcessUtilities.executioner(command)
logging.statusWriter(self.tempStatusPath, 'Extracting Backup File...,40')
###First copy backup file to temp and then Unzip
command = "sudo -u %s cp -R /home/backup/%s* %s" % (VHuser, BackUpFileName, self.tempPath)
ProcessUtilities.executioner(command)
#### Make temp dir ab for unzip
command = "sudo -u %s mkdir %s/ab" % (VHuser, self.tempPath)
ProcessUtilities.executioner(command)
command = "sudo -u %s tar -xvf %s/%s.tar.gz -C %s/ab" % (
VHuser, self.tempPath, BackUpFileName, self.tempPath)
ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Copying Data File...,60')
###Copy backup content to newsite
if home == "0":
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/" % (self.tempPath, oldtemppath)
else:
unzippath = "%s/ab/usr/local/CyberCP/tmp/%s/public_html/public_html/" % (self.tempPath, oldtemppath)
command = "sudo -u %s cp -R %s* %s" % (VHuser, unzippath, newWPpath)
result = ProcessUtilities.outputExecutioner(command)
command = "sudo -u %s cp -R %s.[^.]* %s" % (VHuser, unzippath, newWPpath)
result = ProcessUtilities.outputExecutioner(command)
# dump Mysql file in unzippath path
unzippath2 = "%s/ab/usr/local/CyberCP/tmp/%s/%s" % (self.tempPath, oldtemppath, DumpFileName)
command = "mysql -u root %s < %s" % (Finaldbname, unzippath2)
ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Restoreing Data Base...,80')
#####SetUp DataBase Settings
##set DBName
command = "sudo -u %s %s /usr/bin/wp config set DB_NAME %s --skip-plugins --skip-themes --path=%s" % (
VHuser, FinalPHPPath, Finaldbname, newWPpath)
ProcessUtilities.outputExecutioner(command)
##set DBuser
command = "sudo -u %s %s /usr/bin/wp config set DB_USER %s --skip-plugins --skip-themes --path=%s" % (
VHuser, FinalPHPPath, Finaldbuser, newWPpath)
ProcessUtilities.outputExecutioner(command)
##set DBpasswd
command = "sudo -u %s %s /usr/bin/wp config set DB_PASSWORD %s --skip-plugins --skip-themes --path=%s" % (
VHuser, FinalPHPPath, Finaldbpasswd, newWPpath)
ProcessUtilities.outputExecutioner(command)
logging.statusWriter(self.tempStatusPath, 'Replacing URLs...,90')
########Now Replace URL's
command = 'sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --path=%s "%s" "%s"' % (
VHuser, newWPpath, oldurl, newurl)
ProcessUtilities.outputExecutioner(command)
command = 'sudo -u %s /usr/local/lsws/lsphp74/bin/php -d error_reporting=0 /usr/bin/wp search-replace --skip-plugins --skip-themes --allow-root --path=%s "https://www.%s" "http://%s"' % (
VHuser, newWPpath, newurl, newurl)
ProcessUtilities.outputExecutioner(command)
##Remove temppath
command = f'rm -rf {self.tempPath}'
ProcessUtilities.executioner(command)
###Restart Server
from plogical.installUtilities import installUtilities
installUtilities.reStartLiteSpeed()

View File

@@ -1429,6 +1429,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
$scope.currentStatus = "Starting creation Backups.."; $scope.currentStatus = "Starting creation Backups..";
var data = { var data = {
WPid: $('#WPid').html(), WPid: $('#WPid').html(),
Backuptype: $('#backuptype').val()
} }
var url = "/websites/WPCreateBackup"; var url = "/websites/WPCreateBackup";

View File

@@ -101,6 +101,8 @@
</th> </th>
<th style="padding: 18px; color: white; width: 161px; font-size: 12px;">Website <th style="padding: 18px; color: white; width: 161px; font-size: 12px;">Website
</th> </th>
<th style="padding: 18px; color: white; width: 161px; font-size: 12px;">BackUp Tpye
</th>
<th style="padding: 18px; color: white; width: 161px; font-size: 12px;">Action <th style="padding: 18px; color: white; width: 161px; font-size: 12px;">Action
</th> </th>
@@ -119,6 +121,9 @@
<td style="padding: 13px;"> <td style="padding: 13px;">
{{ sub.title }} {{ sub.title }}
</td> </td>
<td style="padding: 13px;">
{{ sub.Backuptype }}
</td>
<td style="padding: 13px;"> <td style="padding: 13px;">
<a href="{% url 'RestoreHome' %}?BackupID={{ sub.id }}" <a href="{% url 'RestoreHome' %}?BackupID={{ sub.id }}"

View File

@@ -12,44 +12,172 @@
<div ng-controller="WPsiteHome" class="container"> <div ng-controller="WPsiteHome" class="container">
<div id="page-title"> <div id="page-title">
<h2>{{ wpsite.title }}</h2> <h2>{{ wpsite.title }}</h2>
<p>({{ wpsite.path }})<img style="display: none" id="wordpresshomeloading" ng-hide="wordpresshomeloading" <p>({{ wpsite.path }})<img style="display: none" id="wordpresshomeloading" ng-hide="wordpresshomeloading"
src="{% static 'images/loading.gif' %}"></p> src="{% static 'images/loading.gif' %}"></p>
</div> </div>
<div class="panel">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "WordPress Manager" %}
</h3>
<div>
<!-- Product title -->
<h2 style="display: inline" class="mt-0"></h2>
<p style="display: inline;">
</p>
<div class="panel">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "WordPress Manager" %}
</h3>
<div> <div>
<div class="example-box-wrapper">
<ul class="nav-responsive nav nav-tabs">
<!-- Product title --> <li class="active"><a href="#tab1" data-toggle="tab"
<h2 style="display: inline" class="mt-0"></h2> aria-selected="true">General</a></li>
<p style="display: inline;"> <li class=""><a href="#tab2" ng-click="GetCurrentPlugins()"
</p> data-toggle="tab">Plugins</a></li>
<li class=""><a href="#tab3" ng-click="GetCurrentThemes()"
data-toggle="tab">Themes</a></li>
<div> <li><a href="#tab4" data-toggle="tab"
<div class="example-box-wrapper"> ng-click="fetchstaging()">Staging</a></li>
<ul class="nav-responsive nav nav-tabs"> <li><a href="#tab5" data-toggle="tab"
>Backups</a></li>
<li class="active"><a href="#tab1" data-toggle="tab" </ul>
aria-selected="true">General</a></li> <div class="tab-content">
<li class=""><a href="#tab2" ng-click="GetCurrentPlugins()" <div class="tab-pane active" id="tab1">
data-toggle="tab">Plugins</a></li> <div class="d-lg-flex d-none">
<li class=""><a href="#tab3" ng-click="GetCurrentThemes()" <a target="_blank" href="http://{{ wpsite.FinalURL }}">
data-toggle="tab">Themes</a></li> <svg xmlns="http://www.w3.org/2000/svg"
<li><a href="#tab4" data-toggle="tab" xmlns:xlink="http://www.w3.org/1999/xlink"
ng-click="fetchstaging()">Staging</a></li> aria-hidden="true" focusable="false" width="1em"
<li><a href="#tab5" data-toggle="tab" height="1em"
>Backups</a></li> style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
</ul> preserveAspectRatio="xMidYMid meet"
<div class="tab-content"> viewBox="0 0 24 24">
<div class="tab-pane active" id="tab1"> <path d="M13 3l3.293 3.293l-7 7l1.414 1.414l7-7L21 11V3z"
<div class="d-lg-flex d-none"> fill="#626262"></path>
<a target="_blank" href="http://{{ wpsite.FinalURL }}"> <path d="M19 19H5V5h7l-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5l-2-2v7z"
fill="#626262"></path>
</svg>
Open
</a>
<a target="_blank"
href="/filemanager/{{ wpsite.owner.domain }}"
style="margin-left: 4%">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true" focusable="false" width="1em"
height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 1024 1024">
<path d="M159 768h612.3l103.4-256H262.3z"
fill-opacity=".15"
fill="#626262"/>
<path d="M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 0 0-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12c0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"
fill="#626262"/>
</svg>
File Manager
</a>
<a target="_blank" style="margin-left: 4%"
href="{% url 'AutoLogin' %}?id={{ wpsite.id }}">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true" focusable="false" width="1em"
height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 20 20">
<path d="M14 10L8 5v3H1v4h7v3l6-5zm3 7H9v2h8c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2H9v2h8v14z"
fill="#626262"></path>
</svg>
Login
</a>
<a style="margin-left: 4%" target="_blank"
href="/websites/{{ wpsite.owner.domain }}/manageGIT">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true" focusable="false" width="1em"
height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24">
<path d="M17.5 4C15.57 4 14 5.57 14 7.5c0 1.554 1.025 2.859 2.43 3.315c-.146.932-.547 1.7-1.23 2.323c-1.946 1.773-5.527 1.935-7.2 1.907V8.837c1.44-.434 2.5-1.757 2.5-3.337C10.5 3.57 8.93 2 7 2S3.5 3.57 3.5 5.5c0 1.58 1.06 2.903 2.5 3.337v6.326c-1.44.434-2.5 1.757-2.5 3.337C3.5 20.43 5.07 22 7 22s3.5-1.57 3.5-3.5c0-.551-.14-1.065-.367-1.529c2.06-.186 4.657-.757 6.409-2.35c1.097-.997 1.731-2.264 1.904-3.768C19.915 10.438 21 9.1 21 7.5C21 5.57 19.43 4 17.5 4zm-12 1.5C5.5 4.673 6.173 4 7 4s1.5.673 1.5 1.5S7.827 7 7 7s-1.5-.673-1.5-1.5zM7 20c-.827 0-1.5-.673-1.5-1.5a1.5 1.5 0 0 1 1.482-1.498l.13.01A1.495 1.495 0 0 1 7 20zM17.5 9c-.827 0-1.5-.673-1.5-1.5S16.673 6 17.5 6s1.5.673 1.5 1.5S18.327 9 17.5 9z"
fill="#626262"></path>
</svg>
Git Manager
</a>
</div>
<div style="margin-top: 4%">
<div class="row">
<div class="col-md-4">
<h6 style="font-weight: bold">WordPress Version</h6>
<p id="WPVersion" class="text-sm lh-150"></p>
</div>
<div class="col-md-4">
<h6 style="font-weight: bold">PHP</h6>
<p class="text-sm lh-150">{{ wpsite.owner.phpSelection }}</p>
</div>
<div class="col-md-4">
<h6 style="font-weight: bold">LSCache</h6>
<div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('lscache')"
type="checkbox"
class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"
id="lscache">
<label class="custom-control-label"
for="lscache"></label>
</div>
</div>
</div>
</div>
<div style="margin-top: 4%">
<div class="row">
<div class="col-md-4">
<h6 style="font-weight: bold">Debugging</h6>
<div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('debugging')"
type="checkbox"
class="custom-control-input ng-pristine ng-untouched ng-valid ng-empty"
id="debugging">
<label class="custom-control-label"
for="debugging"></label>
</div>
</div>
<div class="col-md-4">
<h6 style="font-weight: bold">Search Engine Indexing</h6>
<div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('searchIndex')"
type="checkbox"
class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"
id="searchIndex">
<label class="custom-control-label"
for="searchIndex"></label>
</div>
</div>
<div class="col-md-4">
<h6 style="font-weight: bold">Maintenance mode</h6>
<div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('maintenanceMode')"
type="checkbox"
class="custom-control-input ng-pristine ng-untouched ng-valid ng-empty"
id="maintenanceMode">
<label class="custom-control-label"
for="maintenanceMode"></label>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="tab2">
<div class="row mb-2">
<div class="col-sm-8">
<a ng-click="UpdatePlugins('all')"
href="javascript:void(0);"
class="btn btn-sm btn-default">
<svg xmlns="http://www.w3.org/2000/svg" <svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true" focusable="false" width="1em" aria-hidden="true" focusable="false" width="1em"
@@ -57,47 +185,51 @@
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet" preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24"> viewBox="0 0 24 24">
<path d="M13 3l3.293 3.293l-7 7l1.414 1.414l7-7L21 11V3z" <path fill="none" stroke="#626262" stroke-width="2"
fill="#626262"></path> d="M2.998 7V1H17.5L21 4.5V23h-6m1-22v5h5M8 23A7 7 0 1 0 8 9a7 7 0 0 0 0 14zm-3.5-6.5L8 13l3.5 3.5m-3.5-3V20"></path>
<path d="M19 19H5V5h7l-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5l-2-2v7z"
fill="#626262"></path>
</svg> </svg>
Open Update All</a>
</a> <a ng-click="UpdatePlugins('selected')"
<a target="_blank" href="javascript:void(0);"
href="/filemanager/{{ wpsite.owner.domain }}" class="btn btn-sm btn-default"> Update
style="margin-left: 4%"> Selected</a>
<svg xmlns="http://www.w3.org/2000/svg" </div>
xmlns:xlink="http://www.w3.org/1999/xlink" <div class="col-sm-4">
aria-hidden="true" focusable="false" width="1em" <div class="text-sm-right">
height="1em" <button data-toggle="modal" data-target="#DeleteWebsite"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" ng-click="DeletePlugins('selected')"
preserveAspectRatio="xMidYMid meet" aria-label=""
viewBox="0 0 1024 1024"> class="btn btn-danger btn-icon-left m-b-10"
<path d="M159 768h612.3l103.4-256H262.3z" type="button">Delete Selected
fill-opacity=".15" </button>
fill="#626262"/> </div>
<path d="M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 0 0-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12c0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z" </div><!-- end col-->
fill="#626262"/> </div>
</svg> <table class="table table-hover mb-0">
File Manager <thead>
</a> <tr>
<a target="_blank" style="margin-left: 4%" <th>
href="{% url 'AutoLogin' %}?id={{ wpsite.id }}"> {% comment %}<div class="custom-control custom-checkbox" style="padding-left: 0px">
<svg xmlns="http://www.w3.org/2000/svg" <input type="checkbox" id="CheckAll">
xmlns:xlink="http://www.w3.org/1999/xlink" <label for="CheckAll"></label>
aria-hidden="true" focusable="false" width="1em" </div>{% endcomment %}
height="1em" </th>
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" <th>Plugin</th>
preserveAspectRatio="xMidYMid meet" <th>State</th>
viewBox="0 0 20 20"> <th>Updates</th>
<path d="M14 10L8 5v3H1v4h7v3l6-5zm3 7H9v2h8c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2H9v2h8v14z" <th>Version</th>
fill="#626262"></path> <th>Delete</th>
</svg> </tr>
Login </thead>
</a> <tbody id="PluginBody">
<a style="margin-left: 4%" target="_blank" </tbody>
href="/websites/{{ wpsite.owner.domain }}/manageGIT"> </table>
</div>
<div class="tab-pane" id="tab3">
<div class="row mb-2">
<div class="col-sm-8">
<a ng-click="UpdateThemes('all')" href="javascript:void(0);"
class="btn btn-sm btn-default">
<svg xmlns="http://www.w3.org/2000/svg" <svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true" focusable="false" width="1em" aria-hidden="true" focusable="false" width="1em"
@@ -105,266 +237,146 @@
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet" preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24"> viewBox="0 0 24 24">
<path d="M17.5 4C15.57 4 14 5.57 14 7.5c0 1.554 1.025 2.859 2.43 3.315c-.146.932-.547 1.7-1.23 2.323c-1.946 1.773-5.527 1.935-7.2 1.907V8.837c1.44-.434 2.5-1.757 2.5-3.337C10.5 3.57 8.93 2 7 2S3.5 3.57 3.5 5.5c0 1.58 1.06 2.903 2.5 3.337v6.326c-1.44.434-2.5 1.757-2.5 3.337C3.5 20.43 5.07 22 7 22s3.5-1.57 3.5-3.5c0-.551-.14-1.065-.367-1.529c2.06-.186 4.657-.757 6.409-2.35c1.097-.997 1.731-2.264 1.904-3.768C19.915 10.438 21 9.1 21 7.5C21 5.57 19.43 4 17.5 4zm-12 1.5C5.5 4.673 6.173 4 7 4s1.5.673 1.5 1.5S7.827 7 7 7s-1.5-.673-1.5-1.5zM7 20c-.827 0-1.5-.673-1.5-1.5a1.5 1.5 0 0 1 1.482-1.498l.13.01A1.495 1.495 0 0 1 7 20zM17.5 9c-.827 0-1.5-.673-1.5-1.5S16.673 6 17.5 6s1.5.673 1.5 1.5S18.327 9 17.5 9z" <path fill="none" stroke="#626262" stroke-width="2"
fill="#626262"></path> d="M2.998 7V1H17.5L21 4.5V23h-6m1-22v5h5M8 23A7 7 0 1 0 8 9a7 7 0 0 0 0 14zm-3.5-6.5L8 13l3.5 3.5m-3.5-3V20"></path>
</svg> </svg>
Git Manager Update All</a>
</a> <a ng-click="UpdateThemes('selected')"
href="javascript:void(0);"
class="btn btn-sm btn-default"> Update
Selected</a>
</div> </div>
<div style="margin-top: 4%"> <div class="col-sm-4">
<div class="row"> <div class="text-sm-right">
<div class="col-md-4"> <button data-toggle="modal" data-target="#DeleteWebsite"
<h6 style="font-weight: bold">WordPress Version</h6> ng-click="DeleteThemes('selected')"
<p id="WPVersion" class="text-sm lh-150"></p> aria-label=""
</div> class="btn btn-danger btn-icon-left m-b-10"
<div class="col-md-4"> type="button">Delete
<h6 style="font-weight: bold">PHP</h6> Selected
<p class="text-sm lh-150">{{ wpsite.owner.phpSelection }}</p> </button>
</div>
<div class="col-md-4">
<h6 style="font-weight: bold">LSCache</h6>
<div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('lscache')"
type="checkbox"
class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"
id="lscache">
<label class="custom-control-label"
for="lscache"></label>
</div>
</div>
</div> </div>
</div> </div><!-- end col-->
<div style="margin-top: 4%">
<div class="row">
<div class="col-md-4">
<h6 style="font-weight: bold">Debugging</h6>
<div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('debugging')"
type="checkbox"
class="custom-control-input ng-pristine ng-untouched ng-valid ng-empty"
id="debugging">
<label class="custom-control-label"
for="debugging"></label>
</div>
</div>
<div class="col-md-4">
<h6 style="font-weight: bold">Search Engine Indexing</h6>
<div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('searchIndex')"
type="checkbox"
class="custom-control-input ng-pristine ng-untouched ng-valid ng-not-empty"
id="searchIndex">
<label class="custom-control-label"
for="searchIndex"></label>
</div>
</div>
<div class="col-md-4">
<h6 style="font-weight: bold">Maintenance mode</h6>
<div class="custom-control custom-switch">
<input ng-click="UpdateWPSettings('maintenanceMode')"
type="checkbox"
class="custom-control-input ng-pristine ng-untouched ng-valid ng-empty"
id="maintenanceMode">
<label class="custom-control-label"
for="maintenanceMode"></label>
</div>
</div>
</div>
</div>
</div> </div>
<div class="tab-pane" id="tab2"> <table class="table table-hover mb-0">
<div class="row mb-2"> <thead>
<div class="col-sm-8"> <tr>
<a ng-click="UpdatePlugins('all')" <th>
href="javascript:void(0);" {% comment %}<div class="custom-control custom-checkbox" style="padding-left: 0px">
class="btn btn-sm btn-default">
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
aria-hidden="true" focusable="false" width="1em"
height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24">
<path fill="none" stroke="#626262" stroke-width="2"
d="M2.998 7V1H17.5L21 4.5V23h-6m1-22v5h5M8 23A7 7 0 1 0 8 9a7 7 0 0 0 0 14zm-3.5-6.5L8 13l3.5 3.5m-3.5-3V20"></path>
</svg>
Update All</a>
<a ng-click="UpdatePlugins('selected')"
href="javascript:void(0);"
class="btn btn-sm btn-default"> Update
Selected</a>
</div>
<div class="col-sm-4">
<div class="text-sm-right">
<button data-toggle="modal" data-target="#DeleteWebsite"
ng-click="DeletePlugins('selected')"
aria-label=""
class="btn btn-danger btn-icon-left m-b-10"
type="button">Delete Selected
</button>
</div>
</div><!-- end col-->
</div>
<table class="table table-hover mb-0">
<thead>
<tr>
<th>
{% comment %}<div class="custom-control custom-checkbox" style="padding-left: 0px">
<input type="checkbox" id="CheckAll"> <input type="checkbox" id="CheckAll">
<label for="CheckAll"></label> <label for="CheckAll"></label>
</div>{% endcomment %} </div>{% endcomment %}
</th> </th>
<th>Plugin</th> <th>Theme</th>
<th>State</th> <th>State</th>
<th>Updates</th> <th>Updates</th>
<th>Version</th> <th>Version</th>
<th>Delete</th> <th>Delete</th>
</tr> </tr>
</thead> </thead>
<tbody id="PluginBody"> <tbody id="ThemeBody">
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="tab-pane" id="tab3"> <div class="tab-pane" id="tab4">
<div class="row mb-2"> <h2>Create Staging site</h2>
<div class="col-sm-8"> <div ng-hide="stagingDetailsForm" class="form-group">
<a ng-click="UpdateThemes('all')" href="javascript:void(0);" <label style="margin-bottom: 2%!important; margin-top: 2%!important;"
class="btn btn-sm btn-default"> class="col-sm-2 control-label">Name</label>
<svg xmlns="http://www.w3.org/2000/svg" <div class="col-sm-10">
xmlns:xlink="http://www.w3.org/1999/xlink" <input style="margin-bottom: 2%!important; margin-top: 2%!important;"
aria-hidden="true" focusable="false" width="1em" type="text" class="form-control" id="stagingName">
height="1em"
style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);"
preserveAspectRatio="xMidYMid meet"
viewBox="0 0 24 24">
<path fill="none" stroke="#626262" stroke-width="2"
d="M2.998 7V1H17.5L21 4.5V23h-6m1-22v5h5M8 23A7 7 0 1 0 8 9a7 7 0 0 0 0 14zm-3.5-6.5L8 13l3.5 3.5m-3.5-3V20"></path>
</svg>
Update All</a>
<a ng-click="UpdateThemes('selected')"
href="javascript:void(0);"
class="btn btn-sm btn-default"> Update
Selected</a>
</div>
<div class="col-sm-4">
<div class="text-sm-right">
<button data-toggle="modal" data-target="#DeleteWebsite"
ng-click="DeleteThemes('selected')"
aria-label=""
class="btn btn-danger btn-icon-left m-b-10"
type="button">Delete
Selected
</button>
</div>
</div><!-- end col-->
</div> </div>
<table class="table table-hover mb-0"> </div>
<div ng-hide="stagingDetailsForm" class="form-group mt-5">
<label style="margin-bottom: 2%!important;"
class="col-sm-2 control-label">Domain Name</label>
<div class="col-sm-10">
<input style="margin-bottom: 2%!important;"
type="text" class="form-control" id="stagingDomain">
</div>
</div>
<div ng-hide="stagingDetailsForm" class="center-div mt-5">
<button ng-click="CreateStagingNow()"
style="margin-bottom: 2%!important;"
class="btn btn-alt btn-hover btn-blue-alt">
<span>Create Now</span>
<i class="glyph-icon icon-arrow-right"></i>
</button>
</div>
<div style="margin-top: 1%" ng-hide="installationProgress" class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-7">
<div class="alert alert-success text-center">
<h2>{$ currentStatus $}</h2>
</div>
<div class="progress">
<div id="installProgress" class="progress-bar"
role="progressbar" aria-valuenow="70"
aria-valuemin="0" aria-valuemax="100"
style="width:0%">
<span class="sr-only">70% Complete</span>
</div>
</div>
<div ng-hide="errorMessageBox" class="alert alert-danger">
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="success" class="alert alert-success">
<p>{% trans "Website succesfully created." %}</p>
</div>
<div ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="form-group center-div">
<div class="col-sm-12">
<button type="button" ng-disabled="goBackDisable"
ng-click="goBack()"
class="btn btn-primary btn-lg center-div">{% trans "Go Back" %}</button>
</div>
</div>
<div class="form-group">
<table class="table table-condensed">
<thead> <thead>
<tr> <tr>
<th> <th>Name</th>
{% comment %}<div class="custom-control custom-checkbox" style="padding-left: 0px"> <th>Domain</th>
<input type="checkbox" id="CheckAll"> <th>Path</th>
<label for="CheckAll"></label> <th>Action</th>
</div>{% endcomment %}
</th>
<th>Theme</th>
<th>State</th>
<th>Updates</th>
<th>Version</th>
<th>Delete</th>
</tr> </tr>
</thead> </thead>
<tbody id="ThemeBody"> <tbody id="StagingBody">
</tbody> </tbody>
</table> </table>
</div>
<div class="tab-pane" id="tab4">
<h2>Create Staging site</h2>
<div ng-hide="stagingDetailsForm" class="form-group">
<label style="margin-bottom: 2%!important; margin-top: 2%!important;"
class="col-sm-2 control-label">Name</label>
<div class="col-sm-10">
<input style="margin-bottom: 2%!important; margin-top: 2%!important;"
type="text" class="form-control" id="stagingName">
</div>
</div>
<div ng-hide="stagingDetailsForm" class="form-group mt-5">
<label style="margin-bottom: 2%!important;"
class="col-sm-2 control-label">Domain Name</label>
<div class="col-sm-10">
<input style="margin-bottom: 2%!important;"
type="text" class="form-control" id="stagingDomain">
</div>
</div>
<div ng-hide="stagingDetailsForm" class="center-div mt-5">
<button ng-click="CreateStagingNow()"
style="margin-bottom: 2%!important;"
class="btn btn-alt btn-hover btn-blue-alt">
<span>Create Now</span>
<i class="glyph-icon icon-arrow-right"></i>
</button>
</div>
<div style="margin-top: 1%" ng-hide="installationProgress" class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-7">
<div class="alert alert-success text-center">
<h2>{$ currentStatus $}</h2>
</div>
<div class="progress">
<div id="installProgress" class="progress-bar"
role="progressbar" aria-valuenow="70"
aria-valuemin="0" aria-valuemax="100"
style="width:0%">
<span class="sr-only">70% Complete</span>
</div>
</div>
<div ng-hide="errorMessageBox" class="alert alert-danger">
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="success" class="alert alert-success">
<p>{% trans "Website succesfully created." %}</p>
</div>
<div ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="form-group center-div">
<div class="col-sm-12">
<button type="button" ng-disabled="goBackDisable"
ng-click="goBack()"
class="btn btn-primary btn-lg center-div">{% trans "Go Back" %}</button>
</div>
</div>
<div class="form-group">
<table class="table table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Domain</th>
<th>Path</th>
<th>Action</th>
</tr>
</thead>
<tbody id="StagingBody">
</tbody>
</table>
</div>
</div> </div>
<div class="tab-pane" id="tab5">
<h2>Create Backup Now</h2> </div>
<div class="col-sm-12" style="margin-top: 1%"> <div class="tab-pane" id="tab5">
<h2>Create Backup Now</h2>
<div class="col-sm-12" style="margin-top: 1%">
<div class="col-sm-12">
<label class="col-sm-3 control-label">{% trans "Select Backip type" %}</label>
<div class="col-sm-6">
<select id="backuptype" class="form-control">
<option value="1">Website and DataBase Both</option>
<option value="2">Only Website Data</option>
<option value="3">Only DataBase</option>
</select>
</div>
</div>
<div class="col-sm-12 center-div" style="margin-top: 4%">
<button id="createbackupbutton" type="button" <button id="createbackupbutton" type="button"
ng-click="CreateBackup()" ng-click="CreateBackup()"
class="btn btn-primary btn-lg center-div">{% trans "Create Backup" %}</button> class="btn btn-primary btn-lg center-div">{% trans "Create Backup" %}</button>
@@ -526,40 +538,40 @@
</div> </div>
</div> </div>
</div> </div>
<div id="DeployToProduction" class="modal fade" role="dialog"> <div id="DeployToProduction" class="modal fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times; <button type="button" class="close" data-dismiss="modal">&times;
</button> </button>
<h4 class="modal-title">DeployToProduction <h4 class="modal-title">DeployToProduction
<img ng-hide="$parent.cyberPanelLoading" <img ng-hide="$parent.cyberPanelLoading"
src="/static/images/loading.gif" src="/static/images/loading.gif"
style="display: none;"> style="display: none;">
</h4> </h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p class="no-margin">When you deploy a <p class="no-margin">When you deploy a
staging site to production, the main staging site to production, the main
site is completely restored with the site is completely restored with the
staging site, so if you have made staging site, so if you have made
any changes to main site they will any changes to main site they will
be lost.</p> be lost.</p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-primary" <button type="button" class="btn btn-primary"
ng-click="FinalDeployToProduction()" data-dismiss="modal">Yes ng-click="FinalDeployToProduction()" data-dismiss="modal">Yes
</button> </button>
<button type="button" ng-disabled="savingSettings" <button type="button" ng-disabled="savingSettings"
class="btn btn-default" data-dismiss="modal"> class="btn btn-default" data-dismiss="modal">
Cancel Cancel
</button> </button>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
{% endblock %} {% endblock %}

View File

@@ -176,12 +176,19 @@ class WebsiteManager:
try: try:
wpsite = WPSites.objects.get(pk=sub.WPSiteID) wpsite = WPSites.objects.get(pk=sub.WPSiteID)
web = wpsite.title web = wpsite.title
config = sub.config
conf = json.loads(config)
Backuptype = conf['Backuptype']
except: except:
web = "Website Not Found" web = "Website Not Found"
Backuptype = "Backup type not exists"
Data['job'].append({ Data['job'].append({
'id': sub.id, 'id': sub.id,
'title': web, 'title': web,
'Backuptype': Backuptype
}) })
@@ -752,6 +759,7 @@ class WebsiteManager:
admin = Administrator.objects.get(pk=userID) admin = Administrator.objects.get(pk=userID)
WPManagerID = data['WPid'] WPManagerID = data['WPid']
Backuptype = data['Backuptype']
wpsite = WPSites.objects.get(pk=WPManagerID) wpsite = WPSites.objects.get(pk=WPManagerID)
@@ -764,6 +772,7 @@ class WebsiteManager:
extraArgs = {} extraArgs = {}
extraArgs['adminID'] = admin.pk extraArgs['adminID'] = admin.pk
extraArgs['WPid'] = WPManagerID extraArgs['WPid'] = WPManagerID
extraArgs['Backuptype'] = Backuptype
extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999)) extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))