mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 05:15:49 +01:00
fix further minor issues in cloudlinux
This commit is contained in:
@@ -92,7 +92,12 @@ class CloudLinuxUsers(CLMain):
|
|||||||
user['username'] = webs.externalApp
|
user['username'] = webs.externalApp
|
||||||
|
|
||||||
if self.ow:
|
if self.ow:
|
||||||
|
if webs.admin.owner == 1:
|
||||||
user['owner'] = webs.admin.userName
|
user['owner'] = webs.admin.userName
|
||||||
|
else:
|
||||||
|
from loginSystem.models import Administrator
|
||||||
|
oAdmin = Administrator.objects.get(pk=webs.admin.owner)
|
||||||
|
user['owner'] = oAdmin.userName
|
||||||
|
|
||||||
if self.domain:
|
if self.domain:
|
||||||
user['domain'] = webs.domain
|
user['domain'] = webs.domain
|
||||||
@@ -133,7 +138,11 @@ class CloudLinuxUsers(CLMain):
|
|||||||
if self.owner == None:
|
if self.owner == None:
|
||||||
websites = Websites.objects.all()
|
websites = Websites.objects.all()
|
||||||
else:
|
else:
|
||||||
websites = Websites.objects.filter(admin__userName=self.owner)
|
from loginSystem.models import Administrator
|
||||||
|
from plogical.acl import ACLManager
|
||||||
|
oAdmin = Administrator.objects.get(userName=self.owner)
|
||||||
|
currentACL = ACLManager.loadedACL(oAdmin.pk)
|
||||||
|
websites = ACLManager.findWebsiteObjects(currentACL, oAdmin.pk)
|
||||||
|
|
||||||
if self.username != None:
|
if self.username != None:
|
||||||
websites = websites.filter(externalApp=self.username)
|
websites = websites.filter(externalApp=self.username)
|
||||||
|
|||||||
@@ -2,10 +2,15 @@
|
|||||||
import getpass
|
import getpass
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
import pwd
|
||||||
if getpass.getuser() == 'root':
|
if getpass.getuser() == 'root':
|
||||||
userType = "admin"
|
userType = "admin"
|
||||||
else:
|
else:
|
||||||
userType = "user"
|
try:
|
||||||
|
uid = pwd.getpwnam(getpass.getuser()).pw_uid
|
||||||
|
userType = 'reseller'
|
||||||
|
except:
|
||||||
|
userType = 'user'
|
||||||
|
|
||||||
data = """{
|
data = """{
|
||||||
"userName": "%s",
|
"userName": "%s",
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ class virtualHostUtilities:
|
|||||||
CLPath = '/etc/sysconfig/cloudlinux'
|
CLPath = '/etc/sysconfig/cloudlinux'
|
||||||
|
|
||||||
if os.path.exists(CLPath):
|
if os.path.exists(CLPath):
|
||||||
command = '/usr/share/cloudlinux/hooks/post_modify_user.py create --username %s --owner %s' % (virtualHostUser, virtualHostUser)
|
command = '/usr/share/cloudlinux/hooks/post_modify_user.py create --username %s --owner %s' % (virtualHostUser, admin.userName)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
### For autodiscover of mail clients.
|
### For autodiscover of mail clients.
|
||||||
|
|||||||
Reference in New Issue
Block a user