mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-09 23:06:16 +01:00
bug fix: full path for add user
This commit is contained in:
@@ -265,15 +265,14 @@ password=%s""" % (rootdbpassword, rootdbpassword)
|
|||||||
from websiteFunctions.models import Websites, ChildDomains
|
from websiteFunctions.models import Websites, ChildDomains
|
||||||
|
|
||||||
for website in Websites.objects.all():
|
for website in Websites.objects.all():
|
||||||
|
|
||||||
confPath = '%s/%s' % (ClusterManager.vhostConfPath, website.domain)
|
confPath = '%s/%s' % (ClusterManager.vhostConfPath, website.domain)
|
||||||
if not os.path.exists(confPath):
|
if not os.path.exists(confPath):
|
||||||
self.PostStatus('Domain %s found in master server, creating on child server now..' % (website.domain))
|
self.PostStatus('Domain %s found in master server, creating on child server now..' % (website.domain))
|
||||||
virtualHostUtilities.createVirtualHost(website.domain, website.adminEmail, website.phpSelection, website.externalApp, 1, 1, 0, website.admin.userName, website.package.packageName, 0, '/home/cyberpanel/temp', 1, 0)
|
virtualHostUtilities.createVirtualHost(website.domain, website.adminEmail, website.phpSelection, website.externalApp, 1, 1, 0, website.admin.userName, website.package.packageName, 0, '/home/cyberpanel/temp', 1, 0)
|
||||||
self.PostStatus('Domain %s successfully created.' % (website.domain))
|
self.PostStatus('Domain %s successfully created.' % (website.domain))
|
||||||
|
|
||||||
## Delete cache folders
|
|
||||||
|
|
||||||
command = 'rm -rf /usr/local/lsws/cachedata'
|
|
||||||
|
|
||||||
for childDomain in ChildDomains.objects.all():
|
for childDomain in ChildDomains.objects.all():
|
||||||
confPath = '%s/%s' % (ClusterManager.vhostConfPath, childDomain.domain)
|
confPath = '%s/%s' % (ClusterManager.vhostConfPath, childDomain.domain)
|
||||||
|
|||||||
@@ -45,13 +45,13 @@ class vhost:
|
|||||||
|
|
||||||
FNULL = open(os.devnull, 'w')
|
FNULL = open(os.devnull, 'w')
|
||||||
if os.path.exists("/etc/lsb-release"):
|
if os.path.exists("/etc/lsb-release"):
|
||||||
command = 'adduser --no-create-home --home ' + path + ' --disabled-login --gecos "" ' + virtualHostUser
|
command = '/usr/sbin/adduser --no-create-home --home ' + path + ' --disabled-login --gecos "" ' + virtualHostUser
|
||||||
else:
|
else:
|
||||||
command = "adduser " + virtualHostUser + " -M -d " + path
|
command = "adduser " + virtualHostUser + " -M -d " + path
|
||||||
|
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = "groupadd " + virtualHostUser
|
command = "/usr/sbin/groupadd " + virtualHostUser
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
command = "usermod -a -G " + virtualHostUser + " " + virtualHostUser
|
command = "usermod -a -G " + virtualHostUser + " " + virtualHostUser
|
||||||
|
|||||||
Reference in New Issue
Block a user