bug fix while creating email

This commit is contained in:
Usman Nasir
2019-08-25 05:25:48 +05:00
parent cbf4f2f5fe
commit a5bf6ca60a
10 changed files with 534 additions and 519 deletions

View File

@@ -952,7 +952,7 @@ class preFlightsChecks:
os.chdir(self.path)
command = "wget http://cyberpanel.sh/CyberPanel.1.8.9.tar.gz"
command = "wget http://cyberpanel.sh/CyberPanel.1.9.0.tar.gz"
#command = "wget http://cyberpanel.sh/CyberPanelTemp.tar.gz"
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
'CyberPanel Download',
@@ -961,7 +961,7 @@ class preFlightsChecks:
##
count = 0
command = "tar zxf CyberPanel.1.8.9.tar.gz"
command = "tar zxf CyberPanel.1.9.0.tar.gz"
#command = "tar zxf CyberPanelTemp.tar.gz"
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
'Extract CyberPanel',1, 1, os.EX_OSERR)
@@ -1053,8 +1053,8 @@ class preFlightsChecks:
try:
path = "/usr/local/CyberCP/version.txt"
writeToFile = open(path, 'w')
writeToFile.writelines('1.8\n')
writeToFile.writelines('9')
writeToFile.writelines('1.9\n')
writeToFile.writelines('0')
writeToFile.close()
except:
pass

View File

@@ -218,7 +218,7 @@ def loadLoginPage(request):
firstName="Cyber",lastName="Panel", acl=acl, token=token)
admin.save()
vers = version(currentVersion="1.8", build=9)
vers = version(currentVersion="1.9", build=0)
vers.save()
package = Package(admin=admin, packageName="Default", diskSpace=1000,

View File

@@ -92,12 +92,14 @@ class MailServerManager:
userName = data['username']
password = data['passwordByPass']
admin = Administrator.objects.get(pk=userID)
if ACLManager.checkOwnership(domainName, admin, currentACL) == 1:
pass
else:
return ACLManager.loadErrorJson()
## Create email entry
result = mailUtilities.createEmailAccount(domainName, userName, password)

View File

@@ -31,7 +31,7 @@ def main():
firstName="Cyber", lastName="Panel", acl=acl, token=token)
admin.save()
vers = version(currentVersion="1.8", build=9)
vers = version(currentVersion="1.9", build=0)
vers.save()
package = Package(admin=admin, packageName="Default", diskSpace=1000,

View File

@@ -440,14 +440,11 @@ class cPanelImporter:
movePath = '%s/homedir/public_html/%s' % (
CompletPathToExtractedArchive, ChildDocRoot.replace(self.documentRoot, '', 1).replace('/', ''))
print movePath
if os.path.exists(movePath):
shutil.move(movePath, path)
else:
movePath = '%s/homedir/%s' % (
CompletPathToExtractedArchive, ChildDocRoot.split('/')[-1].replace(self.documentRoot, '', 1).replace('/', ''))
print movePath
shutil.move(movePath, path)
command = 'chown -R %s:%s %s' % (externalApp, externalApp, path)

View File

@@ -16,6 +16,8 @@ from processUtilities import ProcessUtilities
import os, getpass
import hashlib
import bcrypt
import getpass
try:
from mailServer.models import Domains, EUsers
from emailPremium.models import DomainLimits, EmailLimits
@@ -113,7 +115,7 @@ class mailUtilities:
execPath = "/usr/local/CyberCP/bin/python2 /usr/local/CyberCP/plogical/mailUtilities.py"
execPath = execPath + " AfterEffects --domain " + domain
if os.getlogin() == 'root':
if getpass.getuser() == 'root':
## This is the case when cPanel Importer is running and token is not present in enviroment.
ProcessUtilities.normalExecutioner(execPath)
else:

8
static/backup/backup.js Executable file → Normal file
View File

@@ -680,6 +680,7 @@ app.controller('scheduleBackup', function ($scope, $http, $timeout) {
$scope.couldNotConnect = true;
$scope.scheduleFreq = true;
$scope.scheduleBtn = true;
$scope.localPath = true;
populateCurrentRecords();
@@ -691,6 +692,12 @@ app.controller('scheduleBackup', function ($scope, $http, $timeout) {
$scope.scheduleFreq = false;
$scope.scheduleBtn = true;
if($scope.backupDest === 'Home'){
$scope.localPath = false;
}else{
$scope.localPath = true;
}
};
$scope.scheduleBtnView = function () {
@@ -719,6 +726,7 @@ app.controller('scheduleBackup', function ($scope, $http, $timeout) {
var data = {
backupDest: $scope.backupDest,
backupFreq: $scope.backupFreq,
localPath: $scope.localPathValue
};
var config = {

138
static/dns/dns.js Executable file → Normal file
View File

@@ -40,7 +40,6 @@ app.controller('createNameserver', function($scope,$http) {
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
@@ -57,8 +56,7 @@ app.controller('createNameserver', function($scope,$http) {
$scope.nameServerTwo = $scope.firstNS;
$scope.nameServerOne = $scope.secondNS;
}
else{
} else {
$scope.createNameserverLoading = true;
$scope.nameserverCreationFailed = false;
$scope.nameserverCreated = true;
@@ -68,6 +66,7 @@ app.controller('createNameserver', function($scope,$http) {
}
}
function cantLoadInitialDatas(response) {
$scope.createNameserverLoading = true;
$scope.nameserverCreationFailed = true;
@@ -79,8 +78,6 @@ app.controller('createNameserver', function($scope,$http) {
};
});
/* Java script code to create NS ends here */
@@ -112,7 +109,6 @@ app.controller('createDNSZone', function($scope,$http) {
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
@@ -127,8 +123,7 @@ app.controller('createDNSZone', function($scope,$http) {
$scope.zoneDomain = $scope.zoneDomain;
}
else{
} else {
$scope.createDNSZoneLoading = true;
$scope.dnsZoneCreationFailed = false;
$scope.dnsZoneCreated = true;
@@ -138,6 +133,7 @@ app.controller('createDNSZone', function($scope,$http) {
}
}
function cantLoadInitialDatas(response) {
$scope.createDNSZoneLoading = true;
$scope.dnsZoneCreationFailed = true;
@@ -149,8 +145,6 @@ app.controller('createDNSZone', function($scope,$http) {
};
});
/* Java script code to delete DNS Zone */
@@ -185,9 +179,6 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
$(".caaRecord").hide();
var currentSelection = "aRecord";
$("#" + currentSelection).addClass("active");
@@ -202,7 +193,6 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
};
$scope.fetchRecords = function () {
$scope.recordsLoading = false;
$scope.addRecordsBox = false;
@@ -229,8 +219,7 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
data.priority = $scope.priority;
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "A"){
} else if (type === "A") {
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.recordName;
@@ -238,50 +227,43 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "AAAA"){
} else if (type === "AAAA") {
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.recordName;
data.recordContentAAAA = $scope.recordContentAAAA;
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "CNAME"){
} else if (type === "CNAME") {
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.recordName;
data.recordContentCNAME = $scope.recordContentCNAME;
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "SPF"){
} else if (type === "SPF") {
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.recordName;
data.recordContentSPF = $scope.recordContentSPF;
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "SOA"){
} else if (type === "SOA") {
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.selectedZone;
data.recordContentSOA = $scope.recordContentSOA;
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "TXT"){
} else if (type === "TXT") {
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.recordName;
data.recordContentTXT = $scope.recordContentTXT;
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "NS"){
} else if (type === "NS") {
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.selectedZone;
data.recordContentNS = $scope.recordContentNS;
data.ttl = $scope.ttl;
data.recordType = type;
}
else if(type === "SRV"){
} else if (type === "SRV") {
data.selectedZone = $scope.selectedZone;
data.recordName = $scope.recordName;
data.recordContentSRV = $scope.recordContentSRV;
@@ -297,10 +279,6 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
}
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
@@ -328,8 +306,7 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
$scope.recordsLoading = true;
}
else{
} else {
$scope.recordsFetched = true;
$scope.recordDeleted = true;
@@ -342,6 +319,7 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
}
}
function cantLoadInitialDatas(response) {
$scope.addRecordsBox = true;
@@ -354,13 +332,11 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
$scope.couldNotAddRecord = true;
}
};
function populateCurrentRecords() {
var selectedZone = $scope.selectedZone;
@@ -379,7 +355,6 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
@@ -399,8 +374,7 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
$scope.domainFeteched = $scope.selectedZone;
}
else{
} else {
$scope.addRecordsBox = true;
$scope.currentRecords = true;
@@ -416,6 +390,7 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
}
}
function cantLoadInitialDatas(response) {
$scope.addRecordsBox = true;
@@ -451,7 +426,6 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
@@ -476,9 +450,7 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
populateCurrentRecords();
}
else{
} else {
$scope.addRecordsBox = true;
$scope.currentRecords = true;
@@ -499,6 +471,7 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
}
}
function cantLoadInitialDatas(response) {
$scope.addRecordsBox = false;
@@ -514,21 +487,17 @@ app.controller('addModifyDNSRecords', function($scope,$http) {
$scope.couldNotAddRecord = true;
}
};
});
/* Java script code to delete DNS Zone */
/* Java script code to delete DNS Zone */
app.controller('deleteDNSZone', function ($scope, $http) {
@@ -563,7 +532,6 @@ app.controller('deleteDNSZone', function($scope,$http) {
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
@@ -580,8 +548,7 @@ app.controller('deleteDNSZone', function($scope,$http) {
$scope.deletedZone = $scope.selectedZone;
}
else{
} else {
$scope.deleteZoneButton = true;
$scope.deleteFailure = false;
@@ -593,6 +560,7 @@ app.controller('deleteDNSZone', function($scope,$http) {
}
}
function cantLoadInitialDatas(response) {
$scope.deleteZoneButton = true;
@@ -606,8 +574,70 @@ app.controller('deleteDNSZone', function($scope,$http) {
};
});
/* Java script code to delete DNS Zone */
/* Java script code to create NS */
app.controller('configureDefaultNameservers', function ($scope, $http) {
$scope.cyberPanelLoading = true;
$scope.saveNSConfigurations = function () {
$scope.cyberPanelLoading = false;
url = "/dns/saveNSConfigurations";
var data = {
firstNS: $scope.firstNS,
secondNS: $scope.secondNS,
thirdNS: $scope.thirdNS,
forthNS: $scope.forthNS,
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberPanelLoading = true;
if (response.data.status === 1) {
new PNotify({
title: 'Success!',
text: 'Default nameservers saved.',
type: 'success'
});
} else {
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
};
});
/* Java script code to create NS ends here */

View File

@@ -788,7 +788,6 @@ app.controller('viewContainer', function ($scope, $http) {
$scope.cAction = function (action) {
$('#actionLoading').show();
console.log($scope.cName)
url = "/docker/doContainerAction";
var data = {name: $scope.cName, action: action};
var config = {

View File

@@ -231,9 +231,10 @@ $("#listFail").hide();
app.controller('listWebsites', function ($scope, $http) {
url = "/websites/submitWebsiteListing";
$scope.currentPage = 1;
$scope.recordsToShow = 10;
var data = {page: 1};
$scope.getFurtherWebsitesFromDB = function () {
var config = {
headers: {
@@ -241,38 +242,13 @@ app.controller('listWebsites', function ($scope, $http) {
}
};
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
function ListInitialData(response) {
if (response.data.listWebSiteStatus === 1) {
var finalData = JSON.parse(response.data.data);
$scope.WebSitesList = finalData;
$scope.pagination = response.data.pagination;
$("#listFail").hide();
} else {
$("#listFail").fadeIn();
$scope.errorMessage = response.data.error_message;
}
}
function cantLoadInitialData(response) {
}
$scope.getFurtherWebsitesFromDB = function (pageNumber) {
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
var data = {
page: $scope.currentPage,
recordsToShow: $scope.recordsToShow
};
var data = {page: pageNumber};
dataurl = "/websites/submitWebsiteListing";
dataurl = "/websites/fetchWebsitesList";
$http.post(dataurl, data, config).then(ListInitialData, cantLoadInitialData);
@@ -280,8 +256,9 @@ app.controller('listWebsites', function ($scope, $http) {
function ListInitialData(response) {
if (response.data.listWebSiteStatus === 1) {
var finalData = JSON.parse(response.data.data);
$scope.WebSitesList = finalData;
$scope.WebSitesList = JSON.parse(response.data.data);
$scope.pagination = response.data.pagination;
$scope.clients = JSON.parse(response.data.data);
$("#listFail").hide();
} else {
$("#listFail").fadeIn();
@@ -291,11 +268,11 @@ app.controller('listWebsites', function ($scope, $http) {
}
function cantLoadInitialData(response) {
console.log("not good");
}
};
$scope.getFurtherWebsitesFromDB();
$scope.cyberPanelLoading = true;