pdns replication

This commit is contained in:
Usman Nasir
2019-06-26 03:57:16 +05:00
parent 14b0480e41
commit c02cd2c6c4
13 changed files with 250 additions and 43 deletions

View File

@@ -15,6 +15,7 @@ import shlex
import os
import plogical.CyberCPLogFileWriter as logging
from plogical.acl import ACLManager
from manageServices.models import PDNSStatus
# Create your views here.
@@ -41,6 +42,26 @@ def getAdminStatus(request):
val = request.session['userID']
currentACL = ACLManager.loadedACL(val)
if os.path.exists('/home/cyberpanel/postfix'):
currentACL['emailAsWhole'] = 1
else:
currentACL['emailAsWhole'] = 0
if os.path.exists('/home/cyberpanel/pureftpd'):
currentACL['ftpAsWhole'] = 1
else:
currentACL['ftpAsWhole'] = 0
try:
pdns = PDNSStatus.objects.get(pk=1)
currentACL['dnsAsWhole'] = pdns.serverStatus
except:
if os.path.exists('/etc/pdns'):
PDNSStatus(serverStatus=1).save()
currentACL['dnsAsWhole'] = 1
else:
currentACL['dnsAsWhole'] = 0
json_data = json.dumps(currentACL)
return HttpResponse(json_data)
except KeyError: