File tree 2 files changed +23
-5
lines changed
2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ def sslForHostName(request):
126
126
else :
127
127
return ACLManager .loadError ()
128
128
129
- websitesName = ACLManager .findAllSites (currentACL , userID )
129
+ websitesName = ACLManager .findAllSites (currentACL , userID , 1 )
130
130
131
131
return render (request , 'manageSSL/sslForHostName.html' , {'websiteList' : websitesName })
132
132
except KeyError :
@@ -151,11 +151,15 @@ def obtainHostNameSSL(request):
151
151
data = json .loads (request .body )
152
152
virtualHost = data ['virtualHost' ]
153
153
154
- path = "/home/" + virtualHost + "/public_html"
154
+ try :
155
+ website = Websites .objects .get (domain = virtualHost )
156
+ path = "/home/" + virtualHost + "/public_html"
157
+ except :
158
+ website = ChildDomains .objects .get (domain = virtualHost )
159
+ path = website .path
155
160
156
- data = json .loads (request .body )
157
- virtualHost = data ['virtualHost' ]
158
161
admin = Administrator .objects .get (pk = userID )
162
+
159
163
if ACLManager .checkOwnership (virtualHost , admin , currentACL ) == 1 :
160
164
pass
161
165
else :
Original file line number Diff line number Diff line change @@ -405,13 +405,19 @@ def loadPackageObjects(userID, finalResponse):
405
405
return admin .package_set .all ()
406
406
407
407
@staticmethod
408
- def findAllSites (currentACL , userID ):
408
+ def findAllSites (currentACL , userID , fetchChilds = 0 ):
409
409
websiteNames = []
410
410
411
411
if currentACL ['admin' ] == 1 :
412
412
allWebsites = Websites .objects .all ()
413
+
413
414
for items in allWebsites :
414
415
websiteNames .append (items .domain )
416
+
417
+ if fetchChilds :
418
+ for child in items .childdomains_set .all ():
419
+ websiteNames .append (child .domain )
420
+
415
421
else :
416
422
admin = Administrator .objects .get (pk = userID )
417
423
@@ -421,11 +427,19 @@ def findAllSites(currentACL, userID):
421
427
for items in websites :
422
428
websiteNames .append (items .domain )
423
429
430
+ if fetchChilds :
431
+ for child in items .childdomains_set .all ():
432
+ websiteNames .append (child .domain )
433
+
424
434
for items in admins :
425
435
webs = items .websites_set .all ()
426
436
for web in webs :
427
437
websiteNames .append (web .domain )
428
438
439
+ if fetchChilds :
440
+ for child in web .childdomains_set .all ():
441
+ websiteNames .append (child .domain )
442
+
429
443
430
444
return websiteNames
431
445
You can’t perform that action at this time.
0 commit comments