diff --git a/dns/dnsManager.py b/dns/dnsManager.py index 52c910f1e..8529322b4 100755 --- a/dns/dnsManager.py +++ b/dns/dnsManager.py @@ -598,10 +598,15 @@ class DNSManager: if os.path.exists(cfPath): CloudFlare = 1 + domainsList = ACLManager.findAllDomains(currentACL, userID) - domainsList = ACLManager.findAllDomains(currentACL, userID) + self.admin = admin + self.loadCFKeys() - return render(request, 'dns/addDeleteDNSRecordsCloudFlare.html', {"domainsList": domainsList, "status": 1, 'CloudFlare': CloudFlare}) + return render(request, 'dns/addDeleteDNSRecordsCloudFlare.html', + {"domainsList": domainsList, "status": 1, 'CloudFlare': CloudFlare, 'cfEmail': self.email, 'cfToken': self.key}) + else: + return render(request, 'dns/addDeleteDNSRecordsCloudFlare.html', {"status": 1, 'CloudFlare': CloudFlare}) except BaseException as msg: return HttpResponse(str(msg)) diff --git a/dns/static/dns/dns.js b/dns/static/dns/dns.js index 46aca4e93..06540e5d1 100755 --- a/dns/static/dns/dns.js +++ b/dns/static/dns/dns.js @@ -644,7 +644,7 @@ app.controller('configureDefaultNameservers', function ($scope, $http) { /* Java script code for CloudFlare */ -app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http) { +app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http, $window) { $scope.saveCFConfigs = function () { @@ -678,8 +678,7 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http) { text: 'Changes successfully saved.', type: 'success' }); - - + $window.location.reload(); } else { @@ -965,7 +964,6 @@ app.controller('addModifyDNSRecordsCloudFlare', function ($scope, $http) { } - $scope.deleteRecord = function (id) { diff --git a/dns/templates/dns/addDeleteDNSRecordsCloudFlare.html b/dns/templates/dns/addDeleteDNSRecordsCloudFlare.html index f4d245915..f68f84063 100755 --- a/dns/templates/dns/addDeleteDNSRecordsCloudFlare.html +++ b/dns/templates/dns/addDeleteDNSRecordsCloudFlare.html @@ -63,15 +63,13 @@