mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
add default renderer to manageSSL
This commit is contained in:
@@ -1,49 +1,31 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from plogical.httpProc import httpProc
|
||||||
from django.shortcuts import render, redirect
|
|
||||||
from loginSystem.views import loadLoginPage
|
|
||||||
from websiteFunctions.models import Websites, ChildDomains
|
from websiteFunctions.models import Websites, ChildDomains
|
||||||
from loginSystem.models import Administrator
|
from loginSystem.models import Administrator
|
||||||
from plogical.virtualHostUtilities import virtualHostUtilities
|
from plogical.virtualHostUtilities import virtualHostUtilities
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
import json
|
import json
|
||||||
import shlex
|
|
||||||
import subprocess
|
|
||||||
from plogical.acl import ACLManager
|
from plogical.acl import ACLManager
|
||||||
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
|
||||||
from plogical.processUtilities import ProcessUtilities
|
from plogical.processUtilities import ProcessUtilities
|
||||||
|
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
|
||||||
|
|
||||||
def loadSSLHome(request):
|
def loadSSLHome(request):
|
||||||
try:
|
|
||||||
userID = request.session['userID']
|
userID = request.session['userID']
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
return render(request, 'manageSSL/index.html', currentACL)
|
proc = httpProc(request, 'manageSSL/index.html',
|
||||||
except KeyError:
|
currentACL, 'admin')
|
||||||
return redirect(loadLoginPage)
|
return proc.render()
|
||||||
|
|
||||||
|
|
||||||
def manageSSL(request):
|
def manageSSL(request):
|
||||||
try:
|
|
||||||
userID = request.session['userID']
|
userID = request.session['userID']
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
if currentACL['admin'] == 1:
|
|
||||||
pass
|
|
||||||
elif currentACL['manageSSL'] == 1:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
return ACLManager.loadError()
|
|
||||||
|
|
||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
|
proc = httpProc(request, 'manageSSL/manageSSL.html',
|
||||||
return render(request, 'manageSSL/manageSSL.html', {'websiteList': websitesName})
|
{'websiteList': websitesName}, 'manageSSL')
|
||||||
except KeyError:
|
return proc.render()
|
||||||
return redirect(loadLoginPage)
|
|
||||||
|
|
||||||
|
|
||||||
def issueSSL(request):
|
def issueSSL(request):
|
||||||
@@ -115,22 +97,13 @@ def issueSSL(request):
|
|||||||
|
|
||||||
|
|
||||||
def sslForHostName(request):
|
def sslForHostName(request):
|
||||||
try:
|
|
||||||
userID = request.session['userID']
|
userID = request.session['userID']
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
if currentACL['admin'] == 1:
|
|
||||||
pass
|
|
||||||
elif currentACL['hostnameSSL'] == 1:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
return ACLManager.loadError()
|
|
||||||
|
|
||||||
websitesName = ACLManager.findAllSites(currentACL, userID, 1)
|
websitesName = ACLManager.findAllSites(currentACL, userID, 1)
|
||||||
|
|
||||||
return render(request, 'manageSSL/sslForHostName.html', {'websiteList': websitesName})
|
proc = httpProc(request, 'manageSSL/sslForHostName.html',
|
||||||
except KeyError:
|
{'websiteList': websitesName}, 'hostnameSSL')
|
||||||
return redirect(loadLoginPage)
|
return proc.render()
|
||||||
|
|
||||||
|
|
||||||
def obtainHostNameSSL(request):
|
def obtainHostNameSSL(request):
|
||||||
@@ -197,23 +170,15 @@ def obtainHostNameSSL(request):
|
|||||||
|
|
||||||
|
|
||||||
def sslForMailServer(request):
|
def sslForMailServer(request):
|
||||||
try:
|
|
||||||
userID = request.session['userID']
|
userID = request.session['userID']
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
if currentACL['admin'] == 1:
|
|
||||||
pass
|
|
||||||
elif currentACL['mailServerSSL'] == 1:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
return ACLManager.loadError()
|
|
||||||
|
|
||||||
websitesName = ACLManager.findAllSites(currentACL, userID)
|
websitesName = ACLManager.findAllSites(currentACL, userID)
|
||||||
websitesName = websitesName + ACLManager.findChildDomains(websitesName)
|
websitesName = websitesName + ACLManager.findChildDomains(websitesName)
|
||||||
|
|
||||||
return render(request, 'manageSSL/sslForMailServer.html', {'websiteList': websitesName})
|
proc = httpProc(request, 'manageSSL/sslForMailServer.html',
|
||||||
except KeyError:
|
{'websiteList': websitesName}, 'mailServerSSL')
|
||||||
return redirect(loadLoginPage)
|
return proc.render()
|
||||||
|
|
||||||
|
|
||||||
def obtainMailServerSSL(request):
|
def obtainMailServerSSL(request):
|
||||||
|
|||||||
Reference in New Issue
Block a user