mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
bug fix: mautic and fm upload
This commit is contained in:
@@ -596,6 +596,7 @@ class FileManager:
|
|||||||
finalData['answer'] = 'File transfer completed.'
|
finalData['answer'] = 'File transfer completed.'
|
||||||
|
|
||||||
ACLManager.CreateSecureDir()
|
ACLManager.CreateSecureDir()
|
||||||
|
UploadPath = '/usr/local/CyberCP/tmp/'
|
||||||
|
|
||||||
## Random file name
|
## Random file name
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
|
from plogical.acl import ACLManager
|
||||||
|
|
||||||
sys.path.append('/usr/local/CyberCP')
|
sys.path.append('/usr/local/CyberCP')
|
||||||
import django
|
import django
|
||||||
|
|
||||||
@@ -128,8 +130,8 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
|
|
||||||
## Security Check
|
## Security Check
|
||||||
|
|
||||||
command = 'chmod 755 %s' % (self.permPath)
|
#command = 'chmod 755 %s' % (self.permPath)
|
||||||
ProcessUtilities.executioner(command)
|
#ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
if finalPath.find("..") > -1:
|
if finalPath.find("..") > -1:
|
||||||
raise BaseException("Specified path must be inside virtual host home.")
|
raise BaseException("Specified path must be inside virtual host home.")
|
||||||
@@ -171,7 +173,8 @@ class ApplicationInstaller(multi.Thread):
|
|||||||
else:
|
else:
|
||||||
finalURL = domainName
|
finalURL = domainName
|
||||||
|
|
||||||
localDB = "/home/cyberpanel/" + str(randint(1000, 9999))
|
ACLManager.CreateSecureDir()
|
||||||
|
localDB = '%s/%s' % ('/usr/local/CyberCP/tmp', str(randint(1000, 9999)))
|
||||||
|
|
||||||
localDBContent = """<?php
|
localDBContent = """<?php
|
||||||
// Example local.php to test install (to adapt of course)
|
// Example local.php to test install (to adapt of course)
|
||||||
@@ -202,25 +205,21 @@ $parameters = array(
|
|||||||
writeToFile.close()
|
writeToFile.close()
|
||||||
|
|
||||||
command = 'rm -rf %s/app/config/local.php' % (finalPath)
|
command = 'rm -rf %s/app/config/local.php' % (finalPath)
|
||||||
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
|
command = 'chown %s:%s %s' % (externalApp, externalApp, localDB)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = 'mv %s %s/app/config/local.php' % (localDB, finalPath)
|
command = 'cp %s %s/app/config/local.php' % (localDB, finalPath)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command, externalApp)
|
||||||
|
|
||||||
command = "/usr/local/lsws/lsphp74/bin/php bin/console mautic:install http://%s -f" % (finalURL)
|
command = "/usr/local/lsws/lsphp74/bin/php bin/console mautic:install http://%s -f" % (finalURL)
|
||||||
result = ProcessUtilities.outputExecutioner(command, 'root', None, finalPath)
|
result = ProcessUtilities.outputExecutioner(command, externalApp, None, finalPath)
|
||||||
|
|
||||||
if result.find('Install complete') == -1:
|
if result.find('Install complete') == -1:
|
||||||
raise BaseException(result)
|
raise BaseException(result)
|
||||||
|
|
||||||
|
os.remove(localDB)
|
||||||
##
|
|
||||||
|
|
||||||
from filemanager.filemanager import FileManager
|
|
||||||
|
|
||||||
fm = FileManager(None, None)
|
|
||||||
fm.fixPermissions(self.masterDomain)
|
|
||||||
|
|
||||||
installUtilities.reStartLiteSpeedSocket()
|
installUtilities.reStartLiteSpeedSocket()
|
||||||
|
|
||||||
statusFile = open(tempStatusPath, 'w')
|
statusFile = open(tempStatusPath, 'w')
|
||||||
@@ -251,10 +250,6 @@ $parameters = array(
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
command = 'chmod 750 %s' % (self.permPath)
|
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
|
|
||||||
statusFile = open(self.tempStatusPath, 'w')
|
statusFile = open(self.tempStatusPath, 'w')
|
||||||
statusFile.writelines(str(msg) + " [404]")
|
statusFile.writelines(str(msg) + " [404]")
|
||||||
statusFile.close()
|
statusFile.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user