bug fix: duplicate selectors

This commit is contained in:
usmannasir
2024-01-08 12:49:29 +05:00
parent f895bd5e1e
commit 33c1173a6a
4 changed files with 168 additions and 235 deletions

View File

@@ -127,7 +127,6 @@ class ApplicationInstaller(multi.Thread):
FNULL = open(os.devnull, 'w')
finalPath = ''
self.permPath = ''
@@ -207,9 +206,6 @@ class ApplicationInstaller(multi.Thread):
statusFile.writelines('Downloading Mautic Core,30')
statusFile.close()
#command = "wget https://github.com/mautic/mautic/releases/download/%s/%s.zip" % (
#ApplicationInstaller.MauticVersion, ApplicationInstaller.MauticVersion)
### replace command with composer install
command = f'{phpPath} /usr/bin/composer create-project mautic/recommended-project:^4 {finalPath}'
ProcessUtilities.outputExecutioner(command, externalApp, None)
@@ -218,9 +214,6 @@ class ApplicationInstaller(multi.Thread):
statusFile.writelines('Extracting Mautic Core,50')
statusFile.close()
### replace command with composer install
#command = "unzip %s.zip" % (ApplicationInstaller.MauticVersion)
#ProcessUtilities.outputExecutioner(command, externalApp, None, finalPath)
##
@@ -235,49 +228,6 @@ class ApplicationInstaller(multi.Thread):
finalURL = domainName
# ACLManager.CreateSecureDir()
# localDB = '%s/%s' % ('/usr/local/CyberCP/tmp', str(randint(1000, 9999)))
#
# localDBContent = """<?php
# // Example local.php to test install (to adapt of course)
# $parameters = array(
# // Do not set db_driver and mailer_from_name as they are used to assume Mautic is installed
# 'db_host' => 'localhost',
# 'db_table_prefix' => null,
# 'db_port' => 3306,
# 'db_name' => '%s',
# 'db_user' => '%s',
# 'db_password' => '%s',
# 'db_backup_tables' => true,
# 'db_backup_prefix' => 'bak_',
# 'admin_email' => '%s',
# 'admin_password' => '%s',
# 'mailer_transport' => null,
# 'mailer_host' => null,
# 'mailer_port' => null,
# 'mailer_user' => null,
# 'mailer_password' => null,
# 'mailer_api_key' => null,
# 'mailer_encryption' => null,
# 'mailer_auth_mode' => null,
# );""" % (dbName, dbUser, dbPassword, email, password)
#
# writeToFile = open(localDB, 'w')
# writeToFile.write(localDBContent)
# writeToFile.close()
#command = 'rm -rf %s/app/config/local.php' % (finalPath)
#ProcessUtilities.executioner(command, externalApp)
#command = 'chown %s:%s %s' % (externalApp, externalApp, localDB)
#ProcessUtilities.executioner(command)
#command = 'cp %s %s/app/config/local.php' % (localDB, finalPath)
#ProcessUtilities.executioner(command, externalApp)
### replace install command with comspoer soo
#command = f"{phpPath} bin/console mautic:install http://%s -f" % (finalURL)
command = f"{phpPath} bin/console mautic:install --db_host='localhost' --db_name='{dbName}' --db_user='{dbUser}' --db_password='{dbPassword}' --admin_username='{username}' --admin_email='{email}' --admin_password='{password}' --db_port='3306' http://{finalURL} -f"
result = ProcessUtilities.outputExecutioner(command, externalApp, None, finalPath)

View File

@@ -1402,6 +1402,10 @@ class MailServerManagerUtils(multi.Thread):
for items in postFixLines:
if items.find('myhostname') > -1 and items[0] != '#':
self.mailHostName = items.split('=')[1].strip(' ')
if os.path.exists(ProcessUtilities.debugPath):
logging.CyberCPLogFileWriter.writeToFile(f'Mail server SSL is issued with value: {self.mailHostName}')
self.MailSSL = 1
except BaseException as msg:
self.MailSSL = 0

View File

@@ -2145,6 +2145,8 @@ CREATE TABLE `websiteFunctions_backupsv2` (`id` integer AUTO_INCREMENT NOT NULL
def installLSCPD(branch):
try:
if branch.find('SoftUpgrade') == -1:
Upgrade.stdOut("Starting LSCPD installation..")
cwd = os.getcwd()
@@ -2907,8 +2909,6 @@ vmail
# Upgrade.stdOut("Upgrades are currently disabled")
# return 0
if branch.find('SoftUpgrade') == -1:
if os.path.exists(Upgrade.CentOSPath) or os.path.exists(Upgrade.openEulerPath):
command = 'yum list installed'
Upgrade.installedOutput = subprocess.check_output(shlex.split(command)).decode()
@@ -2931,24 +2931,26 @@ vmail
# os.remove('/usr/local/lsws/conf/httpd_config.xml')
# shutil.copy('httpd_config.xml', '/usr/local/lsws/conf/httpd_config.xml')
postfixPath = '/home/cyberpanel/postfix'
pdns = '/home/cyberpanel/pdns'
pureftpd = '/home/cyberpanel/ftp'
Upgrade.updateRepoURL()
os.chdir("/usr/local")
if os.path.exists(Upgrade.CentOSPath) or os.path.exists(Upgrade.openEulerPath):
command = 'yum remove yum-plugin-priorities -y'
Upgrade.executioner(command, 'remove yum-plugin-priorities', 0)
## Current Version
### if this is a soft upgrade from front end do not stop lscpd, as lscpd is controlling the front end
if branch.find('SoftUpgrade') == -1:
command = "systemctl stop lscpd"
Upgrade.executioner(command, 'stop lscpd', 0)
Upgrade.fixSudoers()
Upgrade.mountTemp()
#Upgrade.mountTemp()
Upgrade.dockerUsers()
Upgrade.setupComposer()
@@ -3066,9 +3068,6 @@ vmail
Upgrade.executioner(command, command, 1)
Upgrade.stdOut("Upgrade Completed.")
else:
pass
def main():

View File

@@ -119,27 +119,7 @@
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Owner" %}</label>
<div class="col-sm-6">
<select ng-model="websiteOwner" class="form-control">
{% for items in owernList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Package" %}</label>
<div class="col-sm-6">
<select ng-model="packageForWebsite" class="form-control">
{% for items in packageList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Owner" %}</label>