fix further minor issues in cloudlinux
This commit is contained in:
parent
46ea3766aa
commit
e36b6b8a6a
|
|
@ -92,7 +92,12 @@ class CloudLinuxUsers(CLMain):
|
|||
user['username'] = webs.externalApp
|
||||
|
||||
if self.ow:
|
||||
user['owner'] = webs.admin.userName
|
||||
if webs.admin.owner == 1:
|
||||
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:
|
||||
user['domain'] = webs.domain
|
||||
|
|
@ -133,7 +138,11 @@ class CloudLinuxUsers(CLMain):
|
|||
if self.owner == None:
|
||||
websites = Websites.objects.all()
|
||||
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:
|
||||
websites = websites.filter(externalApp=self.username)
|
||||
|
|
|
|||
|
|
@ -2,10 +2,15 @@
|
|||
import getpass
|
||||
|
||||
def main():
|
||||
import pwd
|
||||
if getpass.getuser() == 'root':
|
||||
userType = "admin"
|
||||
else:
|
||||
userType = "user"
|
||||
try:
|
||||
uid = pwd.getpwnam(getpass.getuser()).pw_uid
|
||||
userType = 'reseller'
|
||||
except:
|
||||
userType = 'user'
|
||||
|
||||
data = """{
|
||||
"userName": "%s",
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ class virtualHostUtilities:
|
|||
CLPath = '/etc/sysconfig/cloudlinux'
|
||||
|
||||
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)
|
||||
|
||||
### For autodiscover of mail clients.
|
||||
|
|
|
|||
Loading…
Reference in New Issue