@@ -154,11 +154,15 @@ def installWPCLI(self):
154154 except BaseException as msg :
155155 logging .writeToFile (str (msg ) + ' [ApplicationInstaller.installWPCLI]' )
156156
157- def dataLossCheck (self , finalPath , tempStatusPath ):
157+ def dataLossCheck (self , finalPath , externalApp ):
158+ return 1
158159
159- dirFiles = os .listdir (finalPath )
160+ command = 'ls -la %s' % (finalPath )
161+ output = ProcessUtilities .outputExecutioner (command , 'nobody' ).splitlines ()
160162
161- if len (dirFiles ) <= 3 :
163+ logging .writeToFile (str (output ))
164+
165+ if len (output ) <= 3 :
162166 return 1
163167 else :
164168 return 0
@@ -775,13 +779,17 @@ def installJoomla(self):
775779
776780 FNULL = open (os .devnull , 'w' )
777781
782+ permPath = '/home/%s/public_html' % (domainName )
783+ command = 'chmod 755 %s' % (permPath )
784+ ProcessUtilities .executioner (command )
785+
778786 if not os .path .exists (finalPath ):
779787 os .makedirs (finalPath )
780788
781789 ## checking for directories/files
782790
783791 if self .dataLossCheck (finalPath , tempStatusPath ) == 0 :
784- return 0
792+ raise BaseException ( 'Directory is not empty.' )
785793
786794 ## Get Joomla
787795
@@ -794,7 +802,7 @@ def installJoomla(self):
794802 statusFile = open (tempStatusPath , 'w' )
795803 statusFile .writelines ("File already exists." + " [404]" )
796804 statusFile .close ()
797- return 0
805+ raise BaseException ( 'File already exists.' )
798806
799807 command = 'unzip ' + finalPath + 'staging.zip -d ' + finalPath
800808 ProcessUtilities .executioner (command , virtualHostUser )
@@ -898,6 +906,10 @@ def installJoomla(self):
898906
899907 installUtilities .reStartLiteSpeedSocket ()
900908
909+ permPath = '/home/%s/public_html' % (domainName )
910+ command = 'chmod 750 %s' % (permPath )
911+ ProcessUtilities .executioner (command )
912+
901913 statusFile = open (tempStatusPath , 'w' )
902914 statusFile .writelines ("Successfully Installed. [200]" )
903915 statusFile .close ()
@@ -919,6 +931,10 @@ def installJoomla(self):
919931 except :
920932 pass
921933
934+ permPath = '/home/%s/public_html' % (domainName )
935+ command = 'chmod 755 %s' % (permPath )
936+ ProcessUtilities .executioner (command )
937+
922938 statusFile = open (tempStatusPath , 'w' )
923939 statusFile .writelines (str (msg ) + " [404]" )
924940 statusFile .close ()
0 commit comments