From 28c3dfc7af9e8346569fc50dc98a30228888efbb Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 7 Apr 2020 12:58:07 +0500 Subject: [PATCH] bug fix: permissions during cpanel import' --- plogical/cPanelImporter.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/plogical/cPanelImporter.py b/plogical/cPanelImporter.py index 81e2fa95a..a24d0ee3b 100644 --- a/plogical/cPanelImporter.py +++ b/plogical/cPanelImporter.py @@ -713,23 +713,9 @@ class cPanelImporter: return 0 def FixPermissions(self): - externalApp = self.externalApp - command = "sudo chown -R " + externalApp + ":" + externalApp + " /home/" + self.mainDomain - ProcessUtilities.normalExecutioner(command) - - if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - groupName = 'nobody' - else: - groupName = 'nogroup' - - command = "sudo chown -R root:%s /home/" % (groupName) + self.mainDomain + "/logs" - ProcessUtilities.normalExecutioner(command) - - command = "sudo find %s -type d -exec chmod 0755 {} \;" % ("/home/" + self.mainDomain + "/public_html") - ProcessUtilities.normalExecutioner(command) - - command = "sudo find %s -type f -exec chmod 0644 {} \;" % ("/home/" + self.mainDomain + "/public_html") - ProcessUtilities.normalExecutioner(command) + from filemanager.filemanager import FileManager + fm = FileManager(None, None) + fm.fixPermissions(self.mainDomain) def MainController(self):