Usman Nasir
2022-02-28 15:09:15 +05:00
parent 4c3db218c1
commit 332d1f1e02
3 changed files with 215 additions and 171 deletions

View File

@@ -217,68 +217,70 @@
<span class="badge bg-red" id="load3">{$ three $}</span> <span class="badge bg-red" id="load3">{$ three $}</span>
</a>{% endcomment %} </a>{% endcomment %}
{# <div class="dropdown" id="dashnav-btn">#} {# <div class="dropdown" id="dashnav-btn">#}
{# <a href="#" data-toggle="dropdown" data-placement="bottom"#} {# <a href="#" data-toggle="dropdown" data-placement="bottom"#}
{# class="popover-button-header tooltip-button" title="{% trans 'Dashboard Quick Menu' %}">#} {# class="popover-button-header tooltip-button" title="{% trans 'Dashboard Quick Menu' %}">#}
{# <i class="glyph-icon icon-linecons-cog"></i>#} {# <i class="glyph-icon icon-linecons-cog"></i>#}
{# </a>#} {# </a>#}
{# <div class="dropdown-menu float-right">#} {# <div class="dropdown-menu float-right">#}
{# <div class="box-sm">#} {# <div class="box-sm">#}
{# <div class="pad5T pad5B pad10L pad10R dashboard-buttons clearfix">#} {# <div class="pad5T pad5B pad10L pad10R dashboard-buttons clearfix">#}
{# <a href="{% url 'loadWebsitesHome' %}"#} {# <a href="{% url 'loadWebsitesHome' %}"#}
{# class="btn vertical-button remove-border btn-info" title="{% trans '' %}">#} {# class="btn vertical-button remove-border btn-info" title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-dashboard opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-dashboard opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "Websites" %}#} {# {% trans "Websites" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'packagesHome' %}"#} {# <a href="{% url 'packagesHome' %}"#}
{# class="btn vertical-button remove-border btn-danger"#} {# class="btn vertical-button remove-border btn-danger"#}
{# title="{% trans '' %}">#} {# title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-tags opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-tags opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "Packages" %}#} {# {% trans "Packages" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'dnsHome' %}" class="btn vertical-button remove-border btn-purple"#} {# <a href="{% url 'dnsHome' %}" class="btn vertical-button remove-border btn-purple"#}
{# title="{% trans '' %}">#} {# title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-fire opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-fire opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "DNS" %}#} {# {% trans "DNS" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'loadFTPHome' %}"#} {# <a href="{% url 'loadFTPHome' %}"#}
{# class="btn vertical-button remove-border btn-azure"#} {# class="btn vertical-button remove-border btn-azure"#}
{# title="{% trans '' %}">#} {# title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-bar-chart-o opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-bar-chart-o opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "FTP" %}#} {# {% trans "FTP" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'loadTuningHome' %}"#} {# <a href="{% url 'loadTuningHome' %}"#}
{# class="btn vertical-button remove-border btn-yellow" title="{% trans '' %}">#} {# class="btn vertical-button remove-border btn-yellow" title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-laptop opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-laptop opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "Tuning" %}#} {# {% trans "Tuning" %}#}
{# </a>#} {# </a>#}
{# <a href="{% url 'serverStatusHome' %}"#} {# <a href="{% url 'serverStatusHome' %}"#}
{# class="btn vertical-button remove-border btn-warning" title="{% trans '' %}">#} {# class="btn vertical-button remove-border btn-warning" title="{% trans '' %}">#}
{# <span class="glyph-icon icon-separator-vertical pad0A medium">#} {# <span class="glyph-icon icon-separator-vertical pad0A medium">#}
{# <i class="glyph-icon icon-code opacity-80 font-size-20"></i>#} {# <i class="glyph-icon icon-code opacity-80 font-size-20"></i>#}
{# </span>#} {# </span>#}
{# {% trans "Status" %}#} {# {% trans "Status" %}#}
{# </a>#} {# </a>#}
{##} {##}
{# </div>#} {# </div>#}
{##} {##}
{# </div>#} {# </div>#}
{# </div>#} {# </div>#}
{# </div>#} {# </div>#}
<a class="header-btn" target="_blank" href="https://go.cyberpanel.net/community" title="{% trans 'Community' %}"> <a class="header-btn" target="_blank" href="https://go.cyberpanel.net/community"
title="{% trans 'Community' %}">
<i class="glyph-icon icon-comments"></i> <i class="glyph-icon icon-comments"></i>
</a> </a>
<a class="header-btn" target="_blank" href="https://go.cyberpanel.net/support" title="{% trans 'Support' %}"> <a class="header-btn" target="_blank" href="https://go.cyberpanel.net/support"
title="{% trans 'Support' %}">
<i class="glyph-icon icon-support"></i> <i class="glyph-icon icon-support"></i>
</a> </a>
<a class="header-btn" id="logout-btn" href="{% url 'logout' %}" title="{% trans 'Logout' %}"> <a class="header-btn" id="logout-btn" href="{% url 'logout' %}" title="{% trans 'Logout' %}">
@@ -286,7 +288,6 @@
</a> </a>
</div> </div>
<!-- #header-nav-right --> <!-- #header-nav-right -->
@@ -494,124 +495,136 @@
</div><!-- .sidebar-submenu --> </div><!-- .sidebar-submenu -->
</li> </li>
<li class="dnsAsWhole"> {% if dnsAsWhole %}
<a title="{% trans 'DNS' %}">
<i class="glyph-icon icon-sitemap"></i>
<span>{% trans "DNS" %}</span>
</a>
<div class="sidebar-submenu">
<ul> <li class="dnsAsWhole">
{% if admin or createNameServer %} <a title="{% trans 'DNS' %}">
<li><a href="{% url 'createNameserver' %}" <i class="glyph-icon icon-sitemap"></i>
title="{% trans 'Create Nameserver' %}"><span>{% trans "Create Nameserver" %}</span></a> <span>{% trans "DNS" %}</span>
</li> </a>
{% endif %} <div class="sidebar-submenu">
{% if admin %}
<li><a href="{% url 'configureDefaultNameServers' %}"
title="{% trans 'Configure Default Nameservers' %}"><span>{% trans "Config Default Nameservers" %}</span></a>
</li>
{% endif %}
{% if admin or createDNSZone %}
<li><a href="{% url 'createDNSZone' %}"
title="{% trans 'Create DNS Zone' %}"><span>{% trans "Create DNS Zone" %}</span></a>
</li>
{% endif %}
{% if admin or deleteZone %}
<li><a href="{% url 'deleteDNSZone' %}"
title="{% trans 'Delete Zone' %}"><span>{% trans "Delete Zone" %}</span></a>
</li>
{% endif %}
{% if admin or addDeleteRecords %}
<li><a href="{% url 'addDeleteDNSRecords' %}"
title="{% trans 'Add/Delete Records' %}"><span>{% trans "Add/Delete Records" %}</span></a>
</li>
{% endif %}
{% if admin or addDeleteRecords %}
<li class="addDeleteRecords"><a href="{% url 'addDeleteDNSRecordsCloudFlare' %}"
title="{% trans 'CloudFlare' %}"><span>{% trans "CloudFlare" %}</span></a>
</li>
{% endif %}
</ul>
</div><!-- .sidebar-submenu --> <ul>
</li> {% if admin or createNameServer %}
<li><a href="{% url 'createNameserver' %}"
title="{% trans 'Create Nameserver' %}"><span>{% trans "Create Nameserver" %}</span></a>
</li>
{% endif %}
{% if admin %}
<li><a href="{% url 'configureDefaultNameServers' %}"
title="{% trans 'Configure Default Nameservers' %}"><span>{% trans "Config Default Nameservers" %}</span></a>
</li>
{% endif %}
{% if admin or createDNSZone %}
<li><a href="{% url 'createDNSZone' %}"
title="{% trans 'Create DNS Zone' %}"><span>{% trans "Create DNS Zone" %}</span></a>
</li>
{% endif %}
{% if admin or deleteZone %}
<li><a href="{% url 'deleteDNSZone' %}"
title="{% trans 'Delete Zone' %}"><span>{% trans "Delete Zone" %}</span></a>
</li>
{% endif %}
{% if admin or addDeleteRecords %}
<li><a href="{% url 'addDeleteDNSRecords' %}"
title="{% trans 'Add/Delete Records' %}"><span>{% trans "Add/Delete Records" %}</span></a>
</li>
{% endif %}
{% if admin or addDeleteRecords %}
<li class="addDeleteRecords"><a
href="{% url 'addDeleteDNSRecordsCloudFlare' %}"
title="{% trans 'CloudFlare' %}"><span>{% trans "CloudFlare" %}</span></a>
</li>
{% endif %}
</ul>
<li class="emailAsWhole"> </div><!-- .sidebar-submenu -->
<a href="{% url 'loadEmailHome' %}" title="{% trans 'Email' %}"> </li>
<i class="glyph-icon icon-paper-plane"></i>
<span>{% trans "Email" %}</span>
</a>
<div class="sidebar-submenu">
<ul> {% endif %}
{% if admin or createEmail %}
<li><a href="{% url 'createEmailAccount' %}"
title="{% trans 'Create Email Account' %}"><span>{% trans "Create Email" %}</span></a>
</li>
{% endif %}
{% if admin or listEmails %}
<li><a href="{% url 'listEmails' %}"
title="{% trans 'List Emails' %}"><span>{% trans "List Emails" %}</span></a>
</li>
{% endif %}
{% if admin or deleteEmail %}
<li><a href="{% url 'deleteEmailAccount' %}"
title="{% trans 'Delete Email Account' %}"><span>{% trans "Delete Email" %}</span></a>
</li>
{% endif %}
{% if admin or emailForwarding %}
<li><a href="{% url 'emailForwarding' %}"
title="{% trans 'Email Forwarding' %}"><span>{% trans "Email Forwarding" %}</span></a>
</li>
{% endif %}
{% if admin or changeEmailPassword %}
<li><a href="{% url 'changeEmailAccountPassword' %}"
title="{% trans 'Change Password' %}"><span>{% trans "Change Password" %}</span></a>
</li>
{% endif %}
{% if admin or dkimManager %}
<li><a href="{% url 'dkimManager' %}"
title="{% trans 'DKIM Manager' %}"><span>{% trans "DKIM Manager" %}</span></a>
</li>
{% endif %}
{% if admin or createEmail %}
<li><a href="/rainloop/index.php" title="{% trans 'Access Webmail' %}"
target="_blank"><span>{% trans "Access Webmail" %}</span></a>
</li>
{% endif %}
</ul>
</div><!-- .sidebar-submenu --> {% if emailAsWhole %}
</li>
<li class="ftpAsWhole"> <li class="emailAsWhole">
<a href="{% url 'ftpHome' %}" title="{% trans 'FTP' %}"> <a href="{% url 'loadEmailHome' %}" title="{% trans 'Email' %}">
<i class="glyph-icon icon-cloud-upload"></i> <i class="glyph-icon icon-paper-plane"></i>
<span>{% trans "FTP" %}</span> <span>{% trans "Email" %}</span>
</a> </a>
<div class="sidebar-submenu"> <div class="sidebar-submenu">
<ul> <ul>
{% if admin or createFTPAccount %} {% if admin or createEmail %}
<li><a href="{% url 'createFTPAccount' %}" <li><a href="{% url 'createEmailAccount' %}"
title="{% trans 'Create FTP Account' %}"><span>{% trans "Create FTP Account" %}</span></a> title="{% trans 'Create Email Account' %}"><span>{% trans "Create Email" %}</span></a>
</li> </li>
{% endif %} {% endif %}
{% if admin or deleteFTPAccount %} {% if admin or listEmails %}
<li><a href="{% url 'deleteFTPAccount' %}" <li><a href="{% url 'listEmails' %}"
title="{% trans 'Delete FTP Account' %}"><span>{% trans "Delete FTP Account" %}</span></a> title="{% trans 'List Emails' %}"><span>{% trans "List Emails" %}</span></a>
</li> </li>
{% endif %} {% endif %}
{% if admin or listFTPAccounts %} {% if admin or deleteEmail %}
<li><a href="{% url 'listFTPAccounts' %}" <li><a href="{% url 'deleteEmailAccount' %}"
title="{% trans 'List FTP Accounts' %}"><span>{% trans "List FTP Accounts" %}</span></a> title="{% trans 'Delete Email Account' %}"><span>{% trans "Delete Email" %}</span></a>
</li> </li>
{% endif %} {% endif %}
</ul> {% if admin or emailForwarding %}
<li><a href="{% url 'emailForwarding' %}"
title="{% trans 'Email Forwarding' %}"><span>{% trans "Email Forwarding" %}</span></a>
</li>
{% endif %}
{% if admin or changeEmailPassword %}
<li><a href="{% url 'changeEmailAccountPassword' %}"
title="{% trans 'Change Password' %}"><span>{% trans "Change Password" %}</span></a>
</li>
{% endif %}
{% if admin or dkimManager %}
<li><a href="{% url 'dkimManager' %}"
title="{% trans 'DKIM Manager' %}"><span>{% trans "DKIM Manager" %}</span></a>
</li>
{% endif %}
{% if admin or createEmail %}
<li><a href="/rainloop/index.php" title="{% trans 'Access Webmail' %}"
target="_blank"><span>{% trans "Access Webmail" %}</span></a>
</li>
{% endif %}
</ul>
</div><!-- .sidebar-submenu --> </div><!-- .sidebar-submenu -->
</li> </li>
{% endif %}
{% if ftpAsWhole %}
<li class="ftpAsWhole">
<a href="{% url 'ftpHome' %}" title="{% trans 'FTP' %}">
<i class="glyph-icon icon-cloud-upload"></i>
<span>{% trans "FTP" %}</span>
</a>
<div class="sidebar-submenu">
<ul>
{% if admin or createFTPAccount %}
<li><a href="{% url 'createFTPAccount' %}"
title="{% trans 'Create FTP Account' %}"><span>{% trans "Create FTP Account" %}</span></a>
</li>
{% endif %}
{% if admin or deleteFTPAccount %}
<li><a href="{% url 'deleteFTPAccount' %}"
title="{% trans 'Delete FTP Account' %}"><span>{% trans "Delete FTP Account" %}</span></a>
</li>
{% endif %}
{% if admin or listFTPAccounts %}
<li><a href="{% url 'listFTPAccounts' %}"
title="{% trans 'List FTP Accounts' %}"><span>{% trans "List FTP Accounts" %}</span></a>
</li>
{% endif %}
</ul>
</div><!-- .sidebar-submenu -->
</li>
{% endif¬ %}
<li> <li>
<a href="{% url 'loadBackupHome' %}" title="{% trans 'Backup' %}"> <a href="{% url 'loadBackupHome' %}" title="{% trans 'Backup' %}">

View File

@@ -1,6 +1,7 @@
#!/usr/local/CyberCP/bin/python #!/usr/local/CyberCP/bin/python
import os,sys import os,sys
from manageServices.models import PDNSStatus
from .processUtilities import ProcessUtilities from .processUtilities import ProcessUtilities
sys.path.append('/usr/local/CyberCP') sys.path.append('/usr/local/CyberCP')
@@ -863,3 +864,31 @@ class ACLManager:
ProcessUtilities.executioner(command) ProcessUtilities.executioner(command)
@staticmethod
def GetServiceStatus(dic):
if os.path.exists('/home/cyberpanel/postfix'):
dic['emailAsWhole'] = 1
else:
dic['emailAsWhole'] = 0
if os.path.exists('/home/cyberpanel/pureftpd'):
dic['ftpAsWhole'] = 1
else:
dic['ftpAsWhole'] = 0
try:
pdns = PDNSStatus.objects.get(pk=1)
dic['dnsAsWhole'] = pdns.serverStatus
except:
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20:
pdnsPath = '/etc/powerdns'
else:
pdnsPath = '/etc/pdns'
if os.path.exists(pdnsPath):
PDNSStatus(serverStatus=1).save()
dic['dnsAsWhole'] = 1
else:
dic['dnsAsWhole'] = 0

View File

@@ -55,6 +55,8 @@ class httpProc:
except: except:
pass pass
ACLManager.GetServiceStatus(self.data)
self.data.update(currentACL) self.data.update(currentACL)
return render(self.request, self.templateName, self.data) return render(self.request, self.templateName, self.data)