mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-14 01:06:09 +01:00
This commit is contained in:
@@ -126,7 +126,7 @@ def sslForHostName(request):
|
|||||||
else:
|
else:
|
||||||
return ACLManager.loadError()
|
return ACLManager.loadError()
|
||||||
|
|
||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
websitesName = ACLManager.findAllSites(currentACL, userID, 1)
|
||||||
|
|
||||||
return render(request, 'manageSSL/sslForHostName.html', {'websiteList': websitesName})
|
return render(request, 'manageSSL/sslForHostName.html', {'websiteList': websitesName})
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@@ -151,11 +151,15 @@ def obtainHostNameSSL(request):
|
|||||||
data = json.loads(request.body)
|
data = json.loads(request.body)
|
||||||
virtualHost = data['virtualHost']
|
virtualHost = data['virtualHost']
|
||||||
|
|
||||||
path = "/home/" + virtualHost + "/public_html"
|
try:
|
||||||
|
website = Websites.objects.get(domain=virtualHost)
|
||||||
|
path = "/home/" + virtualHost + "/public_html"
|
||||||
|
except:
|
||||||
|
website = ChildDomains.objects.get(domain=virtualHost)
|
||||||
|
path = website.path
|
||||||
|
|
||||||
data = json.loads(request.body)
|
|
||||||
virtualHost = data['virtualHost']
|
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
if ACLManager.checkOwnership(virtualHost, admin, currentACL) == 1:
|
if ACLManager.checkOwnership(virtualHost, admin, currentACL) == 1:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -405,13 +405,19 @@ class ACLManager:
|
|||||||
return admin.package_set.all()
|
return admin.package_set.all()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def findAllSites(currentACL, userID):
|
def findAllSites(currentACL, userID, fetchChilds = 0):
|
||||||
websiteNames = []
|
websiteNames = []
|
||||||
|
|
||||||
if currentACL['admin'] == 1:
|
if currentACL['admin'] == 1:
|
||||||
allWebsites = Websites.objects.all()
|
allWebsites = Websites.objects.all()
|
||||||
|
|
||||||
for items in allWebsites:
|
for items in allWebsites:
|
||||||
websiteNames.append(items.domain)
|
websiteNames.append(items.domain)
|
||||||
|
|
||||||
|
if fetchChilds:
|
||||||
|
for child in items.childdomains_set.all():
|
||||||
|
websiteNames.append(child.domain)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
@@ -421,11 +427,19 @@ class ACLManager:
|
|||||||
for items in websites:
|
for items in websites:
|
||||||
websiteNames.append(items.domain)
|
websiteNames.append(items.domain)
|
||||||
|
|
||||||
|
if fetchChilds:
|
||||||
|
for child in items.childdomains_set.all():
|
||||||
|
websiteNames.append(child.domain)
|
||||||
|
|
||||||
for items in admins:
|
for items in admins:
|
||||||
webs = items.websites_set.all()
|
webs = items.websites_set.all()
|
||||||
for web in webs:
|
for web in webs:
|
||||||
websiteNames.append(web.domain)
|
websiteNames.append(web.domain)
|
||||||
|
|
||||||
|
if fetchChilds:
|
||||||
|
for child in web.childdomains_set.all():
|
||||||
|
websiteNames.append(child.domain)
|
||||||
|
|
||||||
|
|
||||||
return websiteNames
|
return websiteNames
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user