Skip to content

Commit

Permalink
cPanel Importer: Cater domains outside document root
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Aug 24, 2019
1 parent eefaf46 commit cbf4f2f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plogical/cPanelImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,15 @@ def CreateChildDomains(self):
movePath = '%s/homedir/public_html/%s' % (
CompletPathToExtractedArchive, ChildDocRoot.replace(self.documentRoot, '', 1).replace('/', ''))

shutil.move(movePath, path)
print movePath

if os.path.exists(movePath):
shutil.move(movePath, path)
else:
movePath = '%s/homedir/%s' % (
CompletPathToExtractedArchive, ChildDocRoot.split('/')[-1].replace(self.documentRoot, '', 1).replace('/', ''))
print movePath
shutil.move(movePath, path)

command = 'chown -R %s:%s %s' % (externalApp, externalApp, path)
ProcessUtilities.normalExecutioner(command)
Expand Down

2 comments on commit cbf4f2f

@w3servicesdotnet
Copy link

@w3servicesdotnet w3servicesdotnet commented on cbf4f2f Aug 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not working. As subdomain data moving to inside but its not listed on subdomain list.

@usmannasir
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in CyberPanel child domains are always inside the master domain. Above fix will only cater on cPanel site.

Please sign in to comment.