File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,7 @@ def deleteVirtualHostConfigurations(virtualHostName):
349349 vhost .deleteCoreConf (virtualHostName , numberOfSites )
350350
351351 delWebsite = Websites .objects .get (domain = virtualHostName )
352+ externalApp = delWebsite .externalApp
352353
353354 ##
354355
@@ -376,8 +377,16 @@ def deleteVirtualHostConfigurations(virtualHostName):
376377
377378 ## Delete mail accounts
378379
379- command = "sudo rm -rf /home/vmail/" + virtualHostName
380+ command = "rm -rf /home/vmail/" + virtualHostName
380381 subprocess .call (shlex .split (command ))
382+
383+ if ProcessUtilities .decideDistro () == ProcessUtilities .centos :
384+ command = 'userdel %s' % (externalApp )
385+ else :
386+ command = 'deluser %s' % (externalApp )
387+
388+ ProcessUtilities .executioner (command )
389+
381390 except BaseException as msg :
382391 logging .CyberCPLogFileWriter .writeToFile (str (msg ) + " [Not able to remove virtual host configuration from main configuration file.]" )
383392 return 0
You can’t perform that action at this time.
0 commit comments