mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
CloudLinux, CageFS and security improvements
This commit is contained in:
384
static/websiteFunctions/websiteFunctions.js
Executable file → Normal file
384
static/websiteFunctions/websiteFunctions.js
Executable file → Normal file
@@ -2,6 +2,24 @@
|
||||
* Created by usman on 7/26/17.
|
||||
*/
|
||||
|
||||
|
||||
function getCookie(name) {
|
||||
var cookieValue = null;
|
||||
var t = document.cookie;
|
||||
if (document.cookie && document.cookie !== '') {
|
||||
var cookies = document.cookie.split(';');
|
||||
for (var i = 0; i < cookies.length; i++) {
|
||||
var cookie = jQuery.trim(cookies[i]);
|
||||
// Does this cookie string begin with the name we want?
|
||||
if (cookie.substring(0, name.length + 1) === (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
|
||||
/* Java script code to create account */
|
||||
app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
@@ -31,22 +49,19 @@ app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
if ($scope.sslCheck === true) {
|
||||
ssl = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ssl = 0
|
||||
}
|
||||
|
||||
if ($scope.dkimCheck === true) {
|
||||
dkimCheck = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dkimCheck = 0
|
||||
}
|
||||
|
||||
if ($scope.openBasedir === true) {
|
||||
openBasedir = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
openBasedir = 0
|
||||
}
|
||||
|
||||
@@ -84,8 +99,7 @@ app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
|
||||
if (response.data.createWebSiteStatus === 1) {
|
||||
statusFile = response.data.tempStatusPath;
|
||||
getCreationStatus();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.webSiteCreationLoading = true;
|
||||
$scope.installationDetailsForm = true;
|
||||
@@ -125,6 +139,7 @@ app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
|
||||
$scope.goBackDisable = true;
|
||||
$("#installProgress").css("width", "0%");
|
||||
};
|
||||
|
||||
function getCreationStatus() {
|
||||
|
||||
url = "/websites/installWordpressStatus";
|
||||
@@ -163,8 +178,7 @@ app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
$timeout.cancel();
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.webSiteCreationLoading = true;
|
||||
$scope.installationDetailsForm = true;
|
||||
@@ -182,8 +196,7 @@ app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#installProgress").css("width", response.data.installationProgress + "%");
|
||||
$scope.installPercentage = response.data.installationProgress;
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
@@ -238,8 +251,7 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
$scope.WebSitesList = finalData;
|
||||
$scope.pagination = response.data.pagination;
|
||||
$("#listFail").hide();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#listFail").fadeIn();
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
|
||||
@@ -271,8 +283,7 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
var finalData = JSON.parse(response.data.data);
|
||||
$scope.WebSitesList = finalData;
|
||||
$("#listFail").hide();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#listFail").fadeIn();
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
console.log(response.data);
|
||||
@@ -316,8 +327,7 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
text: 'SSL successfully issued.',
|
||||
type: 'success'
|
||||
});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
@@ -367,8 +377,7 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
var finalData = JSON.parse(response.data.data);
|
||||
$scope.WebSitesList = finalData;
|
||||
$("#listFail").hide();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
@@ -381,23 +390,21 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
function cantLoadInitialData(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Connect disrupted, refresh the page.',
|
||||
type: 'error'
|
||||
});
|
||||
title: 'Operation Failed!',
|
||||
text: 'Connect disrupted, refresh the page.',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
/* Java script code to list accounts ends here */
|
||||
|
||||
|
||||
|
||||
/* Java script code to delete Website */
|
||||
|
||||
|
||||
@@ -451,8 +458,7 @@ app.controller('deleteWebsiteControl', function ($scope, $http) {
|
||||
|
||||
$("#deleteLoading").hide();
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#websiteDeleteFailure").hide();
|
||||
$("#websiteDeleteSuccess").fadeIn();
|
||||
$("#deleteWebsiteButton").hide();
|
||||
@@ -523,8 +529,7 @@ app.controller('modifyWebsitesController', function ($scope, $http) {
|
||||
$("#canNotModify").hide();
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
console.log(response.data);
|
||||
$("#modifyWebsiteButton").fadeIn();
|
||||
|
||||
@@ -600,8 +605,7 @@ app.controller('modifyWebsitesController', function ($scope, $http) {
|
||||
$("#modifyWebsiteLoading").hide();
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#modifyWebsiteButton").hide();
|
||||
$("#canNotModify").hide();
|
||||
$("#websiteModifyFailure").hide();
|
||||
@@ -670,12 +674,10 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
if (type == 3) {
|
||||
pageNumber = $scope.pageNumber + 1;
|
||||
$scope.pageNumber = pageNumber;
|
||||
}
|
||||
else if (type == 4) {
|
||||
} else if (type == 4) {
|
||||
pageNumber = $scope.pageNumber - 1;
|
||||
$scope.pageNumber = pageNumber;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
logType = type;
|
||||
}
|
||||
|
||||
@@ -723,9 +725,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
$scope.records = JSON.parse(response.data.data);
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
@@ -768,12 +768,10 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
if (type == 3) {
|
||||
errorPageNumber = $scope.errorPageNumber + 1;
|
||||
$scope.errorPageNumber = errorPageNumber;
|
||||
}
|
||||
else if (type == 4) {
|
||||
} else if (type == 4) {
|
||||
errorPageNumber = $scope.errorPageNumber - 1;
|
||||
$scope.errorPageNumber = errorPageNumber;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
logType = type;
|
||||
}
|
||||
|
||||
@@ -825,9 +823,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
$scope.errorLogsData = response.data.data;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
// notifications
|
||||
|
||||
@@ -949,9 +945,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
$scope.configData = response.data.configData;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
//Rewrite rules
|
||||
$scope.configurationsBoxRewrite = true;
|
||||
@@ -1047,9 +1041,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.saveConfigBtn = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
$scope.configurationsBox = false;
|
||||
$scope.configsFetched = true;
|
||||
$scope.couldNotFetchConfigs = true;
|
||||
@@ -1171,9 +1163,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
$scope.rewriteRules = response.data.rewriteRules;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
// from main
|
||||
$scope.configurationsBox = true;
|
||||
$scope.configsFetched = true;
|
||||
@@ -1279,9 +1269,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.configFileLoading = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
$scope.configurationsBoxRewrite = false;
|
||||
$scope.rewriteRulesFetched = false;
|
||||
$scope.couldNotFetchRewriteRules = true;
|
||||
@@ -1385,8 +1373,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
if (response.data.installStatus == 1) {
|
||||
if (typeof path != 'undefined') {
|
||||
$scope.installationURL = "http://" + domain + "/" + path;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.installationURL = domain;
|
||||
}
|
||||
|
||||
@@ -1396,8 +1383,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.installationSuccessfull = false;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = false;
|
||||
$scope.applicationInstallerLoading = true;
|
||||
@@ -1474,8 +1460,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
if (response.data.installStatus == 1) {
|
||||
if (typeof path != 'undefined') {
|
||||
$scope.installationURL = "http://" + domain + "/" + path;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.installationURL = domain;
|
||||
}
|
||||
|
||||
@@ -1485,8 +1470,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.installationSuccessfull = false;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsFormJoomla = false;
|
||||
$scope.applicationInstallerLoading = true;
|
||||
@@ -1570,9 +1554,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.configFileLoading = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.sslSaved = true;
|
||||
$scope.couldNotSaveSSL = false;
|
||||
@@ -1656,8 +1638,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.configFileLoading = true;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
@@ -1727,22 +1708,19 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
if ($scope.sslCheck === true) {
|
||||
ssl = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ssl = 0
|
||||
}
|
||||
|
||||
if ($scope.dkimCheck === true) {
|
||||
dkimCheck = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dkimCheck = 0
|
||||
}
|
||||
|
||||
if ($scope.openBasedir === true) {
|
||||
openBasedir = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
openBasedir = 0
|
||||
}
|
||||
|
||||
@@ -1782,8 +1760,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
if (response.data.createWebSiteStatus === 1) {
|
||||
statusFile = response.data.tempStatusPath;
|
||||
getCreationStatus();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.domainLoading = true;
|
||||
$scope.installationDetailsForm = true;
|
||||
@@ -1863,8 +1840,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
$timeout.cancel();
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.domainLoading = true;
|
||||
$scope.installationDetailsForm = true;
|
||||
@@ -1882,8 +1858,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#installProgress").css("width", response.data.installationProgress + "%");
|
||||
$scope.installPercentage = response.data.installationProgress;
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
@@ -1960,8 +1935,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.domainLoading = true;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.domainError = false;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.domainLoading = true;
|
||||
@@ -2027,8 +2001,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.childBaseDirChanged = true;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.domainLoading = true;
|
||||
|
||||
@@ -2104,8 +2077,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.domainLoading = true;
|
||||
$scope.childBaseDirChanged = false;
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.phpChanged = true;
|
||||
$scope.domainError = false;
|
||||
@@ -2183,8 +2155,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.sslIssued = true;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
$scope.domainLoading = true;
|
||||
|
||||
@@ -2265,9 +2236,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.sslDomainIssued = childDomain;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
$scope.domainLoading = true;
|
||||
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
@@ -2359,8 +2328,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.openBaseDirBox = false;
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.baseDirLoading = true;
|
||||
$scope.operationFailed = false;
|
||||
@@ -2413,11 +2381,11 @@ RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
||||
|
||||
$scope.applyRewriteTemplate = function () {
|
||||
|
||||
if($scope.rewriteTemplate === "Force HTTP -> HTTPS"){
|
||||
$scope.rewriteRules = httpToHTTPS + $scope.rewriteRules;
|
||||
}else if($scope.rewriteTemplate === "Force NON-WWW -> WWW"){
|
||||
$scope.rewriteRules = nonWWWToWWW + $scope.rewriteRules;
|
||||
}
|
||||
if ($scope.rewriteTemplate === "Force HTTP -> HTTPS") {
|
||||
$scope.rewriteRules = httpToHTTPS + $scope.rewriteRules;
|
||||
} else if ($scope.rewriteTemplate === "Force NON-WWW -> WWW") {
|
||||
$scope.rewriteRules = nonWWWToWWW + $scope.rewriteRules;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2484,8 +2452,7 @@ app.controller('suspendWebsiteControl', function ($scope, $http) {
|
||||
$scope.websiteStatus = websiteName;
|
||||
$scope.finalStatus = "Suspended";
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.suspendLoading = true;
|
||||
$scope.stateView = false;
|
||||
|
||||
@@ -2499,8 +2466,7 @@ app.controller('suspendWebsiteControl', function ($scope, $http) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
if (state == "Suspend") {
|
||||
|
||||
@@ -2513,8 +2479,7 @@ app.controller('suspendWebsiteControl', function ($scope, $http) {
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.suspendLoading = true;
|
||||
$scope.stateView = false;
|
||||
|
||||
@@ -2595,8 +2560,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#modifyCronForm").hide();
|
||||
$("#saveCronButton").hide();
|
||||
$("#addCronButton").hide();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
console.log(response.data);
|
||||
var finalData = response.data.crons;
|
||||
$scope.cronList = finalData;
|
||||
@@ -2646,6 +2610,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
console.log(response);
|
||||
|
||||
@@ -2657,8 +2622,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#modifyCronForm").hide();
|
||||
$("#saveCronButton").hide();
|
||||
$("#addCronButton").hide();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
console.log(response.data);
|
||||
|
||||
$scope.minute = response.data.cron.minute
|
||||
@@ -2703,8 +2667,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#manageCronLoading").hide();
|
||||
if (!$scope.websiteToBeModified) {
|
||||
alert("Please select a domain first");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.minute = $scope.hour = $scope.monthday = $scope.month = $scope.weekday = $scope.command = $scope.line = "";
|
||||
|
||||
$("#cronTable").hide();
|
||||
@@ -2732,7 +2695,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
monthday: $scope.monthday,
|
||||
month: $scope.month,
|
||||
weekday: $scope.weekday,
|
||||
command: $scope.command
|
||||
cronCommand: $scope.command
|
||||
};
|
||||
|
||||
var config = {
|
||||
@@ -2742,6 +2705,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
console.log(response);
|
||||
|
||||
@@ -2751,8 +2715,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#cronEditSuccess").hide();
|
||||
$("#fetchCronFailure").hide();
|
||||
$("#addCronFailure").show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#cronTable").hide();
|
||||
$("#manageCronLoading").hide();
|
||||
$("#cronEditSuccess").show();
|
||||
@@ -2792,6 +2755,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
console.log(response);
|
||||
|
||||
@@ -2801,8 +2765,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#cronEditSuccess").hide();
|
||||
$("#fetchCronFailure").hide();
|
||||
$("#addCronFailure").show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#cronTable").hide();
|
||||
$("#manageCronLoading").hide();
|
||||
$("#cronEditSuccess").show();
|
||||
@@ -2838,7 +2801,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
monthday: $scope.monthday,
|
||||
month: $scope.month,
|
||||
weekday: $scope.weekday,
|
||||
command: $scope.command
|
||||
cronCommand: $scope.command
|
||||
};
|
||||
|
||||
var config = {
|
||||
@@ -2848,6 +2811,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
if (response.data.addNewCron === 0) {
|
||||
@@ -2857,8 +2821,7 @@ app.controller('manageCronController', function ($scope, $http) {
|
||||
$("#cronEditSuccess").hide();
|
||||
$("#fetchCronFailure").hide();
|
||||
$("#addCronFailure").show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
console.log(response.data);
|
||||
$("#cronTable").hide();
|
||||
$("#manageCronLoading").hide();
|
||||
@@ -2915,8 +2878,7 @@ app.controller('manageAliasController', function ($scope, $http, $timeout, $wind
|
||||
|
||||
if ($scope.sslCheck === true) {
|
||||
ssl = 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ssl = 0
|
||||
}
|
||||
|
||||
@@ -2957,8 +2919,7 @@ app.controller('manageAliasController', function ($scope, $http, $timeout, $wind
|
||||
}, 3000);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.aliasTable = true;
|
||||
$scope.addAliasButton = true;
|
||||
@@ -3028,8 +2989,7 @@ app.controller('manageAliasController', function ($scope, $http, $timeout, $wind
|
||||
$scope.operationSuccess = false;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.aliasTable = false;
|
||||
$scope.addAliasButton = true;
|
||||
@@ -3102,8 +3062,7 @@ app.controller('manageAliasController', function ($scope, $http, $timeout, $wind
|
||||
}, 3000);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.aliasTable = false;
|
||||
$scope.addAliasButton = true;
|
||||
@@ -3178,12 +3137,10 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
if (type == 3) {
|
||||
pageNumber = $scope.pageNumber + 1;
|
||||
$scope.pageNumber = pageNumber;
|
||||
}
|
||||
else if (type == 4) {
|
||||
} else if (type == 4) {
|
||||
pageNumber = $scope.pageNumber - 1;
|
||||
$scope.pageNumber = pageNumber;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
logType = type;
|
||||
}
|
||||
|
||||
@@ -3231,9 +3188,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
|
||||
$scope.records = JSON.parse(response.data.data);
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.logFileLoading = true;
|
||||
$scope.logsFeteched = true;
|
||||
@@ -3276,12 +3231,10 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
if (type === 3) {
|
||||
errorPageNumber = $scope.errorPageNumber + 1;
|
||||
$scope.errorPageNumber = errorPageNumber;
|
||||
}
|
||||
else if (type === 4) {
|
||||
} else if (type === 4) {
|
||||
errorPageNumber = $scope.errorPageNumber - 1;
|
||||
$scope.errorPageNumber = errorPageNumber;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
logType = type;
|
||||
}
|
||||
|
||||
@@ -3333,9 +3286,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
|
||||
$scope.errorLogsData = response.data.data;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
// notifications
|
||||
|
||||
@@ -3457,9 +3408,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
|
||||
$scope.configData = response.data.configData;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
//Rewrite rules
|
||||
$scope.configurationsBoxRewrite = true;
|
||||
@@ -3555,9 +3504,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
$scope.saveConfigBtn = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
$scope.configurationsBox = false;
|
||||
$scope.configsFetched = true;
|
||||
$scope.couldNotFetchConfigs = true;
|
||||
@@ -3680,9 +3627,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
|
||||
$scope.rewriteRules = response.data.rewriteRules;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
// from main
|
||||
$scope.configurationsBox = true;
|
||||
$scope.configsFetched = true;
|
||||
@@ -3788,9 +3733,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
$scope.configFileLoading = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
$scope.configurationsBoxRewrite = false;
|
||||
$scope.rewriteRulesFetched = false;
|
||||
$scope.couldNotFetchRewriteRules = true;
|
||||
@@ -3887,9 +3830,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
$scope.configFileLoading = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.sslSaved = true;
|
||||
$scope.couldNotSaveSSL = false;
|
||||
@@ -3975,8 +3916,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.configFileLoading = true;
|
||||
$scope.errorMessage = response.data.error_message;
|
||||
@@ -4062,8 +4002,7 @@ app.controller('launchChild', function ($scope, $http) {
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.openBaseDirBox = false;
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.baseDirLoading = true;
|
||||
$scope.operationFailed = false;
|
||||
@@ -4150,7 +4089,7 @@ app.controller('installWordPressCTRL', function ($scope, $http, $timeout) {
|
||||
path: path,
|
||||
blogTitle: $scope.blogTitle,
|
||||
adminUser: $scope.adminUser,
|
||||
adminPassword: $scope.adminPassword,
|
||||
passwordByPass: $scope.adminPassword,
|
||||
adminEmail: $scope.adminEmail
|
||||
};
|
||||
|
||||
@@ -4168,8 +4107,7 @@ app.controller('installWordPressCTRL', function ($scope, $http, $timeout) {
|
||||
if (response.data.installStatus === 1) {
|
||||
statusFile = response.data.tempStatusPath;
|
||||
getInstallStatus();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -4229,8 +4167,7 @@ app.controller('installWordPressCTRL', function ($scope, $http, $timeout) {
|
||||
|
||||
if (typeof path !== 'undefined') {
|
||||
$scope.installationURL = "http://" + domain + "/" + path;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.installationURL = domain;
|
||||
}
|
||||
|
||||
@@ -4240,8 +4177,7 @@ app.controller('installWordPressCTRL', function ($scope, $http, $timeout) {
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
$timeout.cancel();
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -4258,8 +4194,7 @@ app.controller('installWordPressCTRL', function ($scope, $http, $timeout) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#installProgress").css("width", response.data.installationProgress + "%");
|
||||
$scope.installPercentage = response.data.installationProgress;
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
@@ -4349,8 +4284,7 @@ app.controller('installJoomlaCTRL', function ($scope, $http, $timeout) {
|
||||
|
||||
if (typeof path !== 'undefined') {
|
||||
$scope.installationURL = "http://" + domain + "/" + path;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.installationURL = domain;
|
||||
}
|
||||
|
||||
@@ -4360,8 +4294,7 @@ app.controller('installJoomlaCTRL', function ($scope, $http, $timeout) {
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
$timeout.cancel();
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -4378,8 +4311,7 @@ app.controller('installJoomlaCTRL', function ($scope, $http, $timeout) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#installProgress").css("width", response.data.installationProgress + "%");
|
||||
$scope.installPercentage = response.data.installationProgress;
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
@@ -4431,7 +4363,7 @@ app.controller('installJoomlaCTRL', function ($scope, $http, $timeout) {
|
||||
path: path,
|
||||
sitename: $scope.blogTitle,
|
||||
username: $scope.adminUser,
|
||||
password: $scope.adminPassword,
|
||||
passwordByPass: $scope.adminPassword,
|
||||
prefix: $scope.databasePrefix
|
||||
};
|
||||
|
||||
@@ -4449,8 +4381,7 @@ app.controller('installJoomlaCTRL', function ($scope, $http, $timeout) {
|
||||
if (response.data.installStatus === 1) {
|
||||
statusFile = response.data.tempStatusPath;
|
||||
getInstallStatus();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -4543,8 +4474,7 @@ app.controller('setupGit', function ($scope, $http, $timeout, $window) {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -4562,8 +4492,7 @@ app.controller('setupGit', function ($scope, $http, $timeout, $window) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#installProgress").css("width", response.data.installationProgress + "%");
|
||||
$scope.installPercentage = response.data.installationProgress;
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
@@ -4623,8 +4552,7 @@ app.controller('setupGit', function ($scope, $http, $timeout, $window) {
|
||||
if (response.data.installStatus === 1) {
|
||||
statusFile = response.data.tempStatusPath;
|
||||
getInstallStatus();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -4705,8 +4633,7 @@ app.controller('setupGit', function ($scope, $http, $timeout, $window) {
|
||||
$window.location.reload();
|
||||
}, 3000);
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.failedMesg = false;
|
||||
$scope.successMessage = true;
|
||||
@@ -4764,8 +4691,7 @@ app.controller('setupGit', function ($scope, $http, $timeout, $window) {
|
||||
$scope.couldNotConnect = true;
|
||||
$scope.successMessageBranch = false;
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.failedMesg = false;
|
||||
$scope.successMessage = true;
|
||||
@@ -4857,8 +4783,7 @@ app.controller('installPrestaShopCTRL', function ($scope, $http, $timeout) {
|
||||
|
||||
if (typeof path !== 'undefined') {
|
||||
$scope.installationURL = "http://" + domain + "/" + path;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$scope.installationURL = domain;
|
||||
}
|
||||
|
||||
@@ -4868,8 +4793,7 @@ app.controller('installPrestaShopCTRL', function ($scope, $http, $timeout) {
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
$timeout.cancel();
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -4886,8 +4810,7 @@ app.controller('installPrestaShopCTRL', function ($scope, $http, $timeout) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$("#installProgress").css("width", response.data.installationProgress + "%");
|
||||
$scope.installPercentage = response.data.installationProgress;
|
||||
$scope.currentStatus = response.data.currentStatus;
|
||||
@@ -4942,7 +4865,7 @@ app.controller('installPrestaShopCTRL', function ($scope, $http, $timeout) {
|
||||
lastName: $scope.lastName,
|
||||
databasePrefix: $scope.databasePrefix,
|
||||
email: $scope.email,
|
||||
password: $scope.password
|
||||
passwordByPass: $scope.password
|
||||
};
|
||||
|
||||
var config = {
|
||||
@@ -4959,8 +4882,7 @@ app.controller('installPrestaShopCTRL', function ($scope, $http, $timeout) {
|
||||
if (response.data.installStatus === 1) {
|
||||
statusFile = response.data.tempStatusPath;
|
||||
getInstallStatus();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
|
||||
$scope.installationDetailsForm = true;
|
||||
$scope.installationProgress = false;
|
||||
@@ -4983,4 +4905,68 @@ app.controller('installPrestaShopCTRL', function ($scope, $http, $timeout) {
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
||||
app.controller('sshAccess', function ($scope, $http, $timeout) {
|
||||
|
||||
$scope.wpInstallLoading = true;
|
||||
|
||||
$scope.setupSSHAccess = function () {
|
||||
$scope.wpInstallLoading = false;
|
||||
|
||||
url = "/websites/saveSSHAccessChanges";
|
||||
|
||||
var data = {
|
||||
domain: $("#domainName").text(),
|
||||
externalApp: $("#externalApp").text(),
|
||||
password: $scope.password
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
$scope.wpInstallLoading = true;
|
||||
|
||||
if (response.data.status === 1) {
|
||||
new PNotify({
|
||||
title: 'Success',
|
||||
text: 'Changes Successfully Applied.',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
new PNotify({
|
||||
title: 'Error!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
new PNotify({
|
||||
title: 'Error!',
|
||||
text: 'Could not connect to server, please refresh this page.',
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user