Merge branch 'v1.9.4' into stable

This commit is contained in:
Usman Nasir
2020-02-07 18:11:34 +05:00
5 changed files with 12 additions and 7 deletions

View File

@@ -332,7 +332,10 @@ class FileManager:
writeToFile.write(self.data['fileContent'].encode('utf-8'))
writeToFile.close()
if os.path.islink(self.data['fileName']):
command = 'ls -la %s' % (self.data['fileName'])
output = ProcessUtilities.outputExecutioner(command)
if output.find('lrwxrwxrwx') > -1 and output.find('->') > -1:
return self.ajaxPre(0, 'File exists and is symlink.')
if self.data['fileName'].find(self.data['home']) == -1 or self.data['fileName'].find('..') > -1:

View File

@@ -13,11 +13,9 @@ from loginSystem.models import Administrator
import plogical.CyberCPLogFileWriter as logging
from loginSystem.views import loadLoginPage
from websiteFunctions.models import Websites
from plogical.virtualHostUtilities import virtualHostUtilities
from plogical.ftpUtilities import FTPUtilities
import os
from plogical.acl import ACLManager
from plogical.processUtilities import ProcessUtilities
class FTPManager:
def __init__(self, request):

View File

@@ -37,7 +37,7 @@ class Renew:
if int(diff.days) >= 15:
logging.writeToFile(
'SSL exists for %s and is not ready to renew, skipping..' % (website.domain), 0)
elif x509.get_issuer().get_components()[1][1] == 'Denial':
elif x509.get_issuer().get_components()[1][1].decode('utf-8') == 'Denial':
logging.writeToFile(
'SSL exists for %s and ready to renew..' % (website.domain), 0)
logging.writeToFile(
@@ -45,6 +45,9 @@ class Renew:
virtualHostUtilities.issueSSL(website.domain, '/home/%s/public_html' % (website.domain),
website.adminEmail)
elif x509.get_issuer().get_components()[1][1].decode('utf-8') != "Let's Encrypt":
logging.writeToFile(
'Custom SSL exists for %s and ready to renew..' % (website.domain), 1)
else:
logging.writeToFile(
'SSL exists for %s and ready to renew..' % (website.domain), 0)

View File

@@ -28,7 +28,7 @@ class UserManager(multi.Thread):
def controlUserState(self):
try:
websites = ACLManager.findAllSites(self.extraArgs['currentACL'],self.extraArgs['user'])
websites = ACLManager.findAllSites(self.extraArgs['currentACL'],self.extraArgs['user'].pk)
from websiteFunctions.website import WebsiteManager
wm = WebsiteManager()

View File

@@ -991,7 +991,8 @@ def fetchTableUsers(request):
diskUsage = 0
for webs in items.websites_set.all():
diskUsage = virtualHostUtilities.getDiskUsage("/home/" + webs.domain, webs.package.diskSpace)[0] + diskUsage
#diskUsage = virtualHostUtilities.getDiskUsage("/home/" + webs.domain, webs.package.diskSpace)[0] + diskUsage
diskUsage = 1
owner = Administrator.objects.get(pk=items.owner)
@@ -1052,7 +1053,7 @@ def controlUserState(request):
extraArgs = {}
extraArgs['user'] = user
extraArgs['currentACL'] = currentACL
extraArgs['currentACL'] = ACLManager.loadedACL(user.pk)
extraArgs['state'] = state
from userManagment.userManager import UserManager