Skip to content
Permalink
Browse files
bug fix: joomla install following new perm structure
  • Loading branch information
usmannasir committed Feb 21, 2020
1 parent 794a4f6 commit f15619d8976b85db298dbd83c745679ed8dc772d
Showing 1 changed file with 21 additions and 5 deletions.
@@ -154,11 +154,15 @@ def installWPCLI(self):
except BaseException as msg:
logging.writeToFile(str(msg) + ' [ApplicationInstaller.installWPCLI]')

def dataLossCheck(self, finalPath, tempStatusPath):
def dataLossCheck(self, finalPath, externalApp):
return 1

dirFiles = os.listdir(finalPath)
command = 'ls -la %s' % (finalPath)
output = ProcessUtilities.outputExecutioner(command, 'nobody').splitlines()

if len(dirFiles) <= 3:
logging.writeToFile(str(output))

if len(output) <= 3:
return 1
else:
return 0
@@ -775,13 +779,17 @@ def installJoomla(self):

FNULL = open(os.devnull, 'w')

permPath = '/home/%s/public_html' % (domainName)
command = 'chmod 755 %s' % (permPath)
ProcessUtilities.executioner(command)

if not os.path.exists(finalPath):
os.makedirs(finalPath)

## checking for directories/files

if self.dataLossCheck(finalPath, tempStatusPath) == 0:
return 0
raise BaseException('Directory is not empty.')

## Get Joomla

@@ -794,7 +802,7 @@ def installJoomla(self):
statusFile = open(tempStatusPath, 'w')
statusFile.writelines("File already exists." + " [404]")
statusFile.close()
return 0
raise BaseException('File already exists.')

command = 'unzip ' + finalPath + 'staging.zip -d ' + finalPath
ProcessUtilities.executioner(command, virtualHostUser)
@@ -898,6 +906,10 @@ def installJoomla(self):

installUtilities.reStartLiteSpeedSocket()

permPath = '/home/%s/public_html' % (domainName)
command = 'chmod 750 %s' % (permPath)
ProcessUtilities.executioner(command)

statusFile = open(tempStatusPath, 'w')
statusFile.writelines("Successfully Installed. [200]")
statusFile.close()
@@ -919,6 +931,10 @@ def installJoomla(self):
except:
pass

permPath = '/home/%s/public_html' % (domainName)
command = 'chmod 755 %s' % (permPath)
ProcessUtilities.executioner(command)

statusFile = open(tempStatusPath, 'w')
statusFile.writelines(str(msg) + " [404]")
statusFile.close()

0 comments on commit f15619d

Please sign in to comment.