Skip to content

Commit

Permalink
bug fix while creating email
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Aug 25, 2019
1 parent cbf4f2f commit a5bf6ca
Show file tree
Hide file tree
Showing 10 changed files with 486 additions and 471 deletions.
8 changes: 4 additions & 4 deletions install/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ def download_install_CyberPanel(self, mysqlPassword, mysql):

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',
Expand All @@ -961,7 +961,7 @@ def download_install_CyberPanel(self, mysqlPassword, mysql):
##

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)
Expand Down Expand Up @@ -1053,8 +1053,8 @@ def download_install_CyberPanel(self, mysqlPassword, mysql):
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
Expand Down
2 changes: 1 addition & 1 deletion loginSystem/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions mailServer/mailserverManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ def submitEmailCreation(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion plogical/adminPass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions plogical/cPanelImporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,11 @@ def CreateChildDomains(self):
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)
Expand Down
4 changes: 3 additions & 1 deletion plogical/mailUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import os, getpass
import hashlib
import bcrypt
import getpass

try:
from mailServer.models import Domains, EUsers
from emailPremium.models import DomainLimits, EmailLimits
Expand Down Expand Up @@ -113,7 +115,7 @@ def createEmailAccount(domain, userName, password):
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:
Expand Down
8 changes: 8 additions & 0 deletions static/backup/backup.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ app.controller('scheduleBackup', function ($scope, $http, $timeout) {
$scope.couldNotConnect = true;
$scope.scheduleFreq = true;
$scope.scheduleBtn = true;
$scope.localPath = true;

populateCurrentRecords();

Expand All @@ -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 () {
Expand Down Expand Up @@ -719,6 +726,7 @@ app.controller('scheduleBackup', function ($scope, $http, $timeout) {
var data = {
backupDest: $scope.backupDest,
backupFreq: $scope.backupFreq,
localPath: $scope.localPathValue
};

var config = {
Expand Down
Loading

0 comments on commit a5bf6ca

Please sign in to comment.