diff --git a/dns/views.py b/dns/views.py index 94395b748..cf749bc3c 100644 --- a/dns/views.py +++ b/dns/views.py @@ -265,9 +265,14 @@ def addDeleteDNSRecords(request): for items in domains: domainsList.append(items.name) else: - domains = admin.domains_set.all() - for items in domains: - domainsList.append(items.name) + websites = admin.websites_set.all() + + for web in websites: + try: + tempDomain = Domains.objects.get(name = web.domain) + domainsList.append(web.domain) + except: + pass return render(request, 'dns/addDeleteDNSRecords.html',{"domainsList":domainsList}) diff --git a/static/websiteFunctions/websiteFunctions.js b/static/websiteFunctions/websiteFunctions.js index 52da87047..f783d00d5 100644 --- a/static/websiteFunctions/websiteFunctions.js +++ b/static/websiteFunctions/websiteFunctions.js @@ -672,6 +672,7 @@ app.controller('websitePages', function($scope,$http) { $scope.hidsslconfigs = true; $scope.configurationsBoxRewrite = true; + $scope.changePHPView = true; //Rewrite rules @@ -898,6 +899,7 @@ app.controller('websitePages', function($scope,$http) { $scope.hidsslconfigs = true; $scope.configurationsBox = true; + $scope.changePHPView = true; $scope.configurationsBox = true; @@ -1124,8 +1126,6 @@ app.controller('websitePages', function($scope,$http) { - - //////// Application Installation part $scope.installationDetailsForm = true; @@ -1340,9 +1340,12 @@ app.controller('websitePages', function($scope,$http) { $scope.hidsslconfigs = false; $scope.configurationsBox = true; $scope.configurationsBoxRewrite = true; + $scope.changePHPView = true; }; + + $scope.saveSSL = function(){ @@ -1412,6 +1415,98 @@ app.controller('websitePages', function($scope,$http) { }; + //// Change PHP Master + + $scope.failedToChangePHPMaster = true; + $scope.phpChangedMaster = true; + $scope.couldNotConnect = true; + + $scope.changePHPView = true; + + + $scope.hideChangePHPMaster = function(){ + $scope.changePHPView = true; + }; + + $scope.changePHPMaster = function(){ + $scope.hidsslconfigs = true; + $scope.configurationsBox = true; + $scope.configurationsBoxRewrite = true; + $scope.changePHPView = false; + }; + + + $scope.changePHPVersionMaster = function(childDomain,phpSelection){ + + // notifcations + + $scope.configFileLoading = false; + + var url = "/websites/changePHP"; + + var data = { + childDomain:$("#domainNamePage").text(), + phpSelection:$scope.phpSelectionMaster, + }; + + var config = { + headers : { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + + + if(response.data.changePHP === 1){ + + $scope.configFileLoading = true; + $scope.websiteDomain = $("#domainNamePage").text(); + + + // notifcations + + $scope.failedToChangePHPMaster = true; + $scope.phpChangedMaster = false; + $scope.couldNotConnect = true; + + + } + else{ + + $scope.configFileLoading = true; + $scope.errorMessage = response.data.error_message; + + // notifcations + + $scope.failedToChangePHPMaster = false; + $scope.phpChangedMaster = true; + $scope.couldNotConnect = true; + + } + + + } + function cantLoadInitialDatas(response) { + + $scope.configFileLoading = true; + + // notifcations + + $scope.failedToChangePHPMaster = true; + $scope.phpChangedMaster = true; + $scope.couldNotConnect = false; + + } + + } + + + + ////// create domain part $("#domainCreationForm").hide(); diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 52da87047..f783d00d5 100644 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -672,6 +672,7 @@ app.controller('websitePages', function($scope,$http) { $scope.hidsslconfigs = true; $scope.configurationsBoxRewrite = true; + $scope.changePHPView = true; //Rewrite rules @@ -898,6 +899,7 @@ app.controller('websitePages', function($scope,$http) { $scope.hidsslconfigs = true; $scope.configurationsBox = true; + $scope.changePHPView = true; $scope.configurationsBox = true; @@ -1124,8 +1126,6 @@ app.controller('websitePages', function($scope,$http) { - - //////// Application Installation part $scope.installationDetailsForm = true; @@ -1340,9 +1340,12 @@ app.controller('websitePages', function($scope,$http) { $scope.hidsslconfigs = false; $scope.configurationsBox = true; $scope.configurationsBoxRewrite = true; + $scope.changePHPView = true; }; + + $scope.saveSSL = function(){ @@ -1412,6 +1415,98 @@ app.controller('websitePages', function($scope,$http) { }; + //// Change PHP Master + + $scope.failedToChangePHPMaster = true; + $scope.phpChangedMaster = true; + $scope.couldNotConnect = true; + + $scope.changePHPView = true; + + + $scope.hideChangePHPMaster = function(){ + $scope.changePHPView = true; + }; + + $scope.changePHPMaster = function(){ + $scope.hidsslconfigs = true; + $scope.configurationsBox = true; + $scope.configurationsBoxRewrite = true; + $scope.changePHPView = false; + }; + + + $scope.changePHPVersionMaster = function(childDomain,phpSelection){ + + // notifcations + + $scope.configFileLoading = false; + + var url = "/websites/changePHP"; + + var data = { + childDomain:$("#domainNamePage").text(), + phpSelection:$scope.phpSelectionMaster, + }; + + var config = { + headers : { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + + + if(response.data.changePHP === 1){ + + $scope.configFileLoading = true; + $scope.websiteDomain = $("#domainNamePage").text(); + + + // notifcations + + $scope.failedToChangePHPMaster = true; + $scope.phpChangedMaster = false; + $scope.couldNotConnect = true; + + + } + else{ + + $scope.configFileLoading = true; + $scope.errorMessage = response.data.error_message; + + // notifcations + + $scope.failedToChangePHPMaster = false; + $scope.phpChangedMaster = true; + $scope.couldNotConnect = true; + + } + + + } + function cantLoadInitialDatas(response) { + + $scope.configFileLoading = true; + + // notifcations + + $scope.failedToChangePHPMaster = true; + $scope.phpChangedMaster = true; + $scope.couldNotConnect = false; + + } + + } + + + + ////// create domain part $("#domainCreationForm").hide(); diff --git a/websiteFunctions/templates/websiteFunctions/website.html b/websiteFunctions/templates/websiteFunctions/website.html index 36adfc55d..c844d82c6 100644 --- a/websiteFunctions/templates/websiteFunctions/website.html +++ b/websiteFunctions/templates/websiteFunctions/website.html @@ -241,44 +241,43 @@
{{ domain }}