Merge branch 'v2.3.2-dev' into v2.3.1

This commit is contained in:
Usman Nasir
2022-05-17 11:09:07 +05:00
committed by GitHub
29 changed files with 1988 additions and 753 deletions

View File

@@ -939,6 +939,4 @@ Subject: %s
except BaseException as msg:
logging.statusWriter(self.statusPath, "%s [903:DeleteSnapShot][5009]" % (str(msg)), 1)
return 0
return 0

View File

@@ -1,32 +1,32 @@
# CyberPanel
Webhosting control panel that uses OpenLiteSpeed as web server.
Web Hosting Control Panel that uses OpenLiteSpeed as the underlying Web Server.
## Features
## Features & Services
* Different Level Of users.
* Different User Access Levels (via ACLs).
* Auto SSL.
* FTP Server.
* Light weight DNS Server (PowerDNS).
* PHPMYAdmin.
* Light-weight DNS Server (PowerDNS).
* phpMyAdmin to manage DBs (MariaDB).
* Email Support (SnappyMail).
* FileManager.
* File Manager.
* PHP Managment.
* Firewall (FirewallD & ConfigServer Firewall Intregration).
* One click Backup and Restore.
* Firewall (FirewallD & ConfigServer Firewall Integration).
* One-click Backups and Restores.
# Supported PHPs
# Supported PHP Versions
* PHP 5.3
* PHP 5.4
* PHP 5.5
* PHP 5.6
* PHP 7.0
* PHP 7.1
* PHP 7.2
* PHP 7.3
* PHP 7.4
* PHP 8.0
* PHP 7.4
* PHP 7.3
* PHP 7.2
* PHP 7.1
* PHP 7.0
* PHP 5.6
* PHP 5.5
* PHP 5.4
* PHP 5.3
# Installation Instructions
@@ -35,7 +35,7 @@ Webhosting control panel that uses OpenLiteSpeed as web server.
sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)
```
# Upgrading
# Upgrading CyberPanel
```
@@ -45,8 +45,10 @@ sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgr
# Resources
* [Official Site.](https://cyberpanel.net)
* [Documentation.](https://docs.cyberpanel.net)
* [Forums.](https://forums.cyberpanel.net)
* [Docs (Old).](https://docs.cyberpanel.net)
* [Docs (New).](https://community.cyberpanel.net/docs)
* [Changelog.](https://community.cyberpanel.net/t/change-logs/161)
* [Forums.](https://community.cyberpanel.net)
* [Discord.](https://discord.gg/g8k8Db3)
* [Facebook Group.](https://www.facebook.com/groups/cyberpanel)
* [YouTube Channel.](https://www.youtube.com/channel/UCS6sgUWEhaFl1TO238Ck0xw)

View File

@@ -297,31 +297,31 @@
<ul id="sidebar-menu">
<li class="header"><span>{% trans "Overview" %}</span></li>
<li>
<a href="#" title="{% trans 'Server IP Address' %}">
<a id="sidebar-menu-item-server-ip-address" href="#" title="{% trans 'Server IP Address' %}">
<i class="glyph-icon tooltip-button icon-laptop" title="{% trans 'Server IP Address' %}"
data-original-title=".icon-laptop"></i>
<span style="color: #db6868;font-weight: bold;">{{ ipAddress }}</span>
</a>
<a href="{% url 'index' %}" title="{% trans 'Dashboard' %}">
<a id="sidebar-menu-item-dashboard" href="{% url 'index' %}" title="{% trans 'Dashboard' %}">
<i class="glyph-icon icon-dashboard"></i>
<span>{% trans "Dashboard" %}</span>
</a>
{% if admin or versionManagement %}
<a href="{% url 'versionManagment' %}"
<a id="sidebar-menu-item-version-management" href="{% url 'versionManagment' %}"
title="{% trans 'Version Management' %}">
<i class="glyph-icon tooltip-button icon-info"
title="{% trans 'Version Management' %}" data-original-title=".icon-cloud-upload"
aria-describedby="tooltip896208"></i>
<span>{% trans "Version Management" %}</span>
</a>
<a href="{% url 'design' %}"
<a id="sidebar-menu-item-design" href="{% url 'design' %}"
title="{% trans 'Design' %}">
<i class="glyph-icon tooltip-button icon-cog"
title="{% trans 'Design' %}" data-original-title=".icon-cloud-upload"
aria-describedby="tooltip896208"></i>
<span>{% trans "Design" %}</span>
</a>
<a href="https://go.cyberpanel.net/cloud"
<a id="sidebar-menu-item-connect" href="https://go.cyberpanel.net/cloud"
title="{% trans 'Connect' %}">
<i class="glyph-icon tooltip-button icon-link" title="{% trans 'Connect' %}"
data-original-title=".icon-cloud-upload" aria-describedby="tooltip896208"></i>
@@ -339,7 +339,7 @@
<li class="divider"></li>
<li class="header"><span>{% trans "Main" %}</span></li>
<li>
<li id="sidebar-menu-item-users">
<a href="{% url 'loadUsersHome' %}" title="{% trans 'Users' %}">
<i class="glyph-icon icon-users" title="{% trans 'Users' %}"></i>
<span>{% trans "Users" %}</span>
@@ -389,6 +389,34 @@
</div><!-- .sidebar-submenu -->
</li>
<li id="sidebar-menu-item-websites">
<!-------------WordPress--------------------------->
<li>
<a href="{% url 'loadWebsitesHome' %}" title="{% trans 'WordPress' %}">
<div class="glyph-icon icon-wordpress" title="{% trans 'WordPress' %}"></div>
<span>{% trans "Wordpresss" %}</span>
</a>
<div class="sidebar-submenu">
<ul>
{% if admin or createWebsite %}
<li><a href="{% url 'createWordpress' %}"
title="{% trans 'Create Worpress' %}"><span>{% trans "Create Worpress" %}</span></a>
</li>
{% endif %}
<li><a href="#"
title="{% trans 'List Websites' %}"><span>{% trans "List Worpress" %}</span></a>
</li>
<li><a href="{% url 'ConfigurePlugins' %}"
title="{% trans 'ConfigurePlugins' %}"><span>{% trans "Configure Plugins" %}</span></a>
</li>
</ul>
</div><!-- .sidebar-submenu -->
</li>
<li>
<a href="{% url 'loadWebsitesHome' %}" title="{% trans 'Websites' %}">
<div class="glyph-icon icon-globe" title="{% trans 'Websites' %}"></div>
@@ -397,11 +425,12 @@
<div class="sidebar-submenu">
<ul>
{% if admin or createWebsite %}
{% if admin or createWebsite %}
<li><a href="{% url 'createWebsite' %}"
title="{% trans 'Create Website' %}"><span>{% trans "Create Website" %}</span></a>
</li>
{% endif %}
<li><a href="{% url 'listWebsites' %}"
title="{% trans 'List Websites' %}"><span>{% trans "List Websites" %}</span></a>
</li>
@@ -430,7 +459,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-packages">
<a id="packageHome" href="{% url 'packagesHome' %}" title="{% trans 'Packages' %}">
<i class="glyph-icon icon-cubes"></i>
<span>{% trans "Packages" %}</span>
@@ -462,7 +491,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-databases">
<a title="{% trans 'Databases' %}">
<i class="glyph-icon icon-database" title="{% trans 'Databases' %}"></i>
<span>{% trans "Databases" %}</span>
@@ -497,7 +526,7 @@
{% if dnsAsWhole %}
<li class="dnsAsWhole">
<li id="sidebar-menu-item-dns" class="dnsAsWhole">
<a title="{% trans 'DNS' %}">
<i class="glyph-icon icon-sitemap"></i>
<span>{% trans "DNS" %}</span>
@@ -545,7 +574,7 @@
{% if emailAsWhole %}
<li class="emailAsWhole">
<li id="sidebar-menu-item-email" class="emailAsWhole">
<a href="{% url 'loadEmailHome' %}" title="{% trans 'Email' %}">
<i class="glyph-icon icon-paper-plane"></i>
<span>{% trans "Email" %}</span>
@@ -596,7 +625,7 @@
{% endif %}
{% if ftpAsWhole %}
<li class="ftpAsWhole">
<li id="sidebar-menu-item-ftp" class="ftpAsWhole">
<a href="{% url 'ftpHome' %}" title="{% trans 'FTP' %}">
<i class="glyph-icon icon-cloud-upload"></i>
<span>{% trans "FTP" %}</span>
@@ -626,7 +655,7 @@
{% endif %}
<li>
<li id="sidebar-menu-item-backup">
<a href="{% url 'loadBackupHome' %}" title="{% trans 'Backup' %}">
<i class="glyph-icon tooltip-button icon-copy" title=".icon-folder"></i>
<span>{% trans "Backup" %}</span>
@@ -670,7 +699,7 @@
</li>
<li>
<li id="sidebar-menu-item-incremental-backup">
<a href="{% url 'loadBackupHome' %}" title="{% trans 'Incremental Backup - Beta' %}">
<i class="glyph-icon tooltip-button icon-save" title="Incremental Backup"></i>
<span>{% trans "Incremental Backup" %}</span>
@@ -704,7 +733,7 @@
</li>
<li>
<li id="sidebar-menu-item-ssl">
<a href="{% url 'loadSSLHome' %}" title="{% trans 'Backup' %}">
<i class="glyph-icon tooltip-button icon-lock" title="{% trans 'SSL' %}"></i>
<span>{% trans "SSL" %}</span>
@@ -762,7 +791,7 @@
{# </div><!-- .sidebar-submenu -->#}
{# </li>#}
<li>
<li id="sidebar-menu-item-cloudlinux">
<a href="#" title="{% trans 'CloudLinux' %}">
<i class="glyph-icon icon-linecons-fire"></i>
<span>{% trans "CloudLinux" %}</span>
@@ -794,7 +823,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-containerization">
<a href="#" title="{% trans 'Containerization' %}">
<i class="glyph-icon icon-linecons-fire"></i>
<span>{% trans "Containerization" %}</span>
@@ -811,7 +840,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-docker">
<a href="#" title="{% trans 'Docker' %}">
<i class="glyph-icon icon-cogs"></i>
<span>{% trans "Docker Manager" %}</span>
@@ -834,7 +863,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-tuning">
<a href="#" title="{% trans 'Tuning' %}">
<i class="glyph-icon icon-adjust"></i>
<span>{% trans "Tuning" %}</span>
@@ -853,7 +882,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-server-status">
<a href="#" title="{% trans 'Server Status' %}">
<i class="glyph-icon icon-cog"></i>
<span>{% trans "Server Status" %}</span>
@@ -878,7 +907,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-php">
<a href="{% url 'loadPHPHome' %}" title="{% trans 'PHP' %}">
<i class="glyph-icon icon-code"></i>
<span>{% trans "PHP" %}</span>
@@ -897,7 +926,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-server-status">
<a href="{% url 'logsHome' %}" title="{% trans 'Server Status' %}">
<i class="glyph-icon icon-file"></i>
<span>{% trans "Logs" %}</span>
@@ -931,7 +960,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-security">
<a href="{% url 'securityHome' %}" title="{% trans 'Security' %}">
<i class="glyph-icon icon-shield"></i>
<span>{% trans "Security" %}</span>
@@ -968,7 +997,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li class="emailAsWhole">
<li id="sidebar-menu-item-mail-settings" class="emailAsWhole">
<a href="#" title="{% trans 'Mail Settings' %}">
<i class="glyph-icon icon-envelope"></i>
<span>{% trans "Mail Settings" %}</span>
@@ -1000,7 +1029,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-manage-services">
<a href="#" title="{% trans 'Manage Services' %}">
<i class="glyph-icon icon-folder-open"></i>
<span>{% trans "Manage Services" %}</span>
@@ -1028,7 +1057,7 @@
</div><!-- .sidebar-submenu -->
</li>
<li>
<li id="sidebar-menu-item-plugins">
<a href="#" title="{% trans 'Plugins' %}">
<i class="glyph-icon icon-plug"></i>
<span>{% trans "Plugins" %}</span>

View File

@@ -1,87 +1,97 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Version Management - CyberPanel" %}"{% endblock %}
{% block title %}{% trans "Version Management - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% load static %}
<div class="container">
<div id="page-title">
<h2>{% trans "Version Management" %}</h2>
<p>{% trans "On this page you can manage versions and or upgrade to latest version of CyberPanel" %}</p>
</div>
{% if Notecheck %}
<div class="container">
<div id="page-title">
<h2>{% trans "Version Management" %}</h2>
<p>{% trans "On this page you can manage versions and or upgrade to latest version of CyberPanel" %}</p>
</div>
{% if Notecheck %}
<div class="alert alert-info">
<p style="color:red; font-weight: bold ;">{% trans "Note: Latest commit does not match, please upgrade." %}</p>
<p style="color:red; font-weight: bold ;">{% trans "Note: Latest commit does not match, please upgrade." %}</p>
</div>
{% endif %}
<div class="panel">
<div class="panel-body">
<h3 class="title-hero">
CyberPanel
</h3>
<div ng-controller="versionManagment" class="example-box-wrapper">
<div class="panel">
<div class="panel-body">
<h3 class="title-hero">
CyberPanel
</h3>
<div ng-controller="versionManagment" class="example-box-wrapper">
<form action="/" class="form-horizontal bordered-row">
<div class="form-group">
<form action="/" class="form-horizontal bordered-row">
<div class="form-group">
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Current Version :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ currentVersion }} </div>
<label class="col-sm-3 control-label "
style="margin: 0px!important; padding: 0px!important;">{% trans "Current Version :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9"
style="margin: 0px!important; padding: 0px!important;">{{ currentVersion }} </div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label "
style="margin: 0px!important; padding: 0px!important;">{% trans "Build :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9"
style="margin: 0px!important; padding: 0px!important;">{{ build }} </div>
<label class="col-sm-3 control-label "
style="margin: 0px!important; padding: 0px!important;">{% trans "Current Commit :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9"
style="margin: 0px!important; padding: 0px!important;">{{ Currentcomt }} </div>
<div class="form-group">
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Build :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ build }} </div>
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Current Commit :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ Currentcomt }} </div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label "
style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Version :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9"
style="margin: 0px!important; padding: 0px!important;">{{ latestVersion }} </div>
<div class="form-group">
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Version :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestVersion }} </div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label "
style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Build :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9"
style="margin: 0px!important; padding: 0px!important;">{{ latestBuild }} </div>
<label class="col-sm-3 control-label "
style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Commit :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9"
style="margin: 0px!important; padding: 0px!important;">{{ latestcomit }} </div>
{% comment %}<label class="col-sm-3 control-label "
style="margin: 0px!important; padding: 0px!important;">{% trans "# commits since update :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9"
style="margin: 0px!important; padding: 0px!important;">{{ numCommits }} </div>{% endcomment %}
</div>
<div ng-hide="upgradelogBox" class="form-group">
<div class="col-sm-12">
<textarea ng-model="upgradeLog" rows="30" class="form-control">{{ logs }}</textarea>
</div>
</div>
</form>
</div>
<div class="form-group">
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Build :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestBuild }} </div>
<label class="col-sm-3 control-label " style="margin: 0px!important; padding: 0px!important;">{% trans "Latest Commit :" %}&nbsp&nbsp</label>
<div class="current-pack col-sm-9" style="margin: 0px!important; padding: 0px!important;">{{ latestcomit }} </div>
</div>
<div ng-hide="upgradelogBox" class="form-group">
<div class="col-sm-12">
<textarea ng-model="upgradeLog" rows="30" class="form-control">{{ logs }}</textarea>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% endblock %}

View File

@@ -119,10 +119,18 @@ def versionManagment(request):
output = ProcessUtilities.outputExecutioner(command)
Currentcomt = output.rstrip("\n")
notechk = True;
notechk = True
# command ="git fetch -C /usr/local/CyberCP/"
# output = ProcessUtilities.outputExecutioner(command)
#
# command ="git -C /usr/local/CyberCP/ log %s..%s --pretty=oneline | wc -l" % ( Currentcomt, latestcomit)
# output = ProcessUtilities.outputExecutioner(command)
#
# numCommits = output.rstrip("\n")
if(Currentcomt == latestcomit):
notechk = False;
notechk = False
template = 'baseTemplate/versionManagment.html'
@@ -241,6 +249,13 @@ def design(request):
cosmetic = CyberPanelCosmetic()
cosmetic.save()
val = request.session['userID']
currentACL = ACLManager.loadedACL(val)
if currentACL['admin'] == 1:
pass
else:
return ACLManager.loadErrorJson('reboot', 0)
finalData = {}
if request.method == 'POST':

View File

@@ -266,12 +266,12 @@ elif grep -q -E "CloudLinux 7|CloudLinux 8" /etc/os-release ; then
Server_OS="CloudLinux"
elif grep -q -E "Rocky Linux" /etc/os-release ; then
Server_OS="RockyLinux"
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10" /etc/os-release ; then
elif grep -q -E "Ubuntu 18.04|Ubuntu 20.04|Ubuntu 20.10|Ubuntu 22.04" /etc/os-release ; then
Server_OS="Ubuntu"
else
echo -e "Unable to detect your system..."
echo -e "\nCyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x, RockyLinux 8.x, CloudLinux 7.x, CloudLinux 8.x...\n"
Debug_Log2 "CyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x, RockyLinux 8.x, CloudLinux 7.x, CloudLinux 8.x... [404]"
echo -e "\nCyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, Ubuntu 22.04 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x, RockyLinux 8.x, CloudLinux 7.x, CloudLinux 8.x...\n"
Debug_Log2 "CyberPanel is supported on Ubuntu 18.04 x86_64, Ubuntu 20.04 x86_64, Ubuntu 20.10 x86_64, Ubuntu 22.04 x86_64, CentOS 7.x, CentOS 8.x, AlmaLinux 8.x, RockyLinux 8.x, CloudLinux 7.x, CloudLinux 8.x... [404]"
exit
fi
@@ -998,8 +998,13 @@ else
apt install -y --allow-downgrades libgnutls30=3.6.13-2ubuntu1.3
fi
DEBIAN_FRONTEND=noninteracitve apt install -y dnsutils net-tools htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip
Check_Return
if [[ "$Server_OS_Version" = "22" ]] ; then
DEBIAN_FRONTEND=noninteracitve apt install -y dnsutils net-tools htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip libmariadb-dev-compat libmariadb-dev
Check_Return
else
DEBIAN_FRONTEND=noninteracitve apt install -y dnsutils net-tools htop telnet libcurl4-gnutls-dev libgnutls28-dev libgcrypt20-dev libattr1 libattr1-dev liblzma-dev libgpgme-dev libmariadbclient-dev libcurl4-gnutls-dev libssl-dev nghttp2 libnghttp2-dev idn2 libidn2-dev libidn2-0-dev librtmp-dev libpsl-dev nettle-dev libgnutls28-dev libldap2-dev libgssapi-krb5-2 libk5crypto3 libkrb5-dev libcomerr2 libldap2-dev virtualenv git socat vim unzip zip
Check_Return
fi
DEBIAN_FRONTEND=noninteractive apt install -y python3-pip
Check_Return
@@ -1027,8 +1032,13 @@ Retry_Command "pip install --default-timeout=3600 virtualenv==16.7.9"
Download_Requirement
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" = "22" ]] ; then
python3 -m venv /usr/local/CyberPanel
Check_Return
else
virtualenv -p /usr/bin/python3 /usr/local/CyberPanel
Check_Return
fi
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" != "20" ]] ; then
# shellcheck disable=SC1091
@@ -1723,7 +1733,14 @@ rm -f /root/cyberpanel/cert_conf
Post_Install_Required_Components() {
Debug_Log2 "Finalization..,80"
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" = "22" ]] ; then
python3 -m venv /usr/local/CyberCP
Check_Return
else
virtualenv -p /usr/bin/python3 /usr/local/CyberCP
Check_Return
fi
if [[ "$Server_OS" = "Ubuntu" ]] && [[ "$Server_OS_Version" = "20" ]] ; then
# shellcheck disable=SC1091
@@ -1789,6 +1806,7 @@ mkdir -p /etc/opendkim
echo '/usr/local/CyberPanel/bin/python /usr/local/CyberCP/plogical/adminPass.py --password $@' > /usr/bin/adminPass
echo "systemctl restart lscpd" >> /usr/bin/adminPass
echo "echo \$@ > /etc/cyberpanel/adminPass" >> /usr/bin/adminPass
chmod 700 /usr/bin/adminPass
rm -f /usr/bin/php

View File

@@ -674,7 +674,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
var data = {
completeStartingPath: completePathToFile,
method: "listForTable",
home: homePathBack,
home: "/",
domainRandomSeed: domainRandomSeed,
domainName: domainName
};
@@ -1201,9 +1201,11 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
pathbase = $scope.currentPath;
}
$scope.extractionLoading = false;
var completeFileToExtract = $scope.currentRPath + "/" + allFilesAndFolders[0];
var completeFileToExtract = pathbase + "/" + allFilesAndFolders[0];
var extractionType = "";
if (findFileExtension(completeFileToExtract) == "gz") {
@@ -1825,4 +1827,4 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
};
});
});

View File

@@ -1,5 +0,0 @@
[CyberPanel]
name=CyberPanel
baseurl=https://rep.cyberpanel.net/
gpgkey=https://rep.cyberpanel.net/RPM-GPG-KEY-cyberpanel
gpgcheck=1

View File

@@ -1,5 +0,0 @@
[CyberPanel]
name=CyberPanel
baseurl=https://rep.cyberpanel.net/
gpgkey=https://rep.cyberpanel.net/RPM-GPG-KEY-cyberpanel
gpgcheck=1

View File

@@ -1827,6 +1827,10 @@ imap_folder_list_limit = 0
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
if self.distro == cent8:
command = 'dnf install opendkim-tools -y'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
if self.distro == ubuntu:
command = 'apt install opendkim-tools -y'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
@@ -2047,6 +2051,8 @@ milter_default_action = accept
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = 'yum install -y restic'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = 'restic self-update'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
else:
command = 'apt-get update -y'
@@ -2054,6 +2060,9 @@ milter_default_action = accept
command = 'apt-get install restic -y'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
command = 'restic self-update'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
except:
pass

File diff suppressed because it is too large Load Diff

View File

@@ -378,6 +378,7 @@ class IncScheduler(multi.Thread):
GDriveJobLogs(owner=items, status=backupSchedule.INFO,
message='Job Completed').save()
print("job com[leted")
#logging.writeToFile('job completed')

View File

@@ -615,7 +615,7 @@ class ACLManager:
doms = items.websites_set.all().order_by('domain')
for dom in doms:
domainsList.append(dom.domain)
for childs in items.childdomains_set.all():
for childs in dom.childdomains_set.all():
domainsList.append(childs.domain)
return domainsList

View File

@@ -18,19 +18,20 @@ class findBWUsage:
if not os.path.exists(path):
return 0
logData = open(path, 'r').readlines()
from processUtilities import ProcessUtilities
logData = ProcessUtilities.outputExecutioner('cat %s' % (path), 'nobody').splitlines()
logDataLines = len(logData)
if not os.path.exists("/home/"+domainName+"/logs"):
return 0
bwmeta = "/home/" + domainName + "/logs/bwmeta"
bwmeta = "/home/cyberpanel/%s.bwmeta" % (domainName)
if not os.path.exists(path):
writeMeta = open(bwmeta, 'w')
writeMeta.writelines('0\n0\n')
writeMeta.close()
os.chmod(bwmeta, 0o600)
return 1
if os.path.exists(bwmeta):
@@ -56,6 +57,8 @@ class findBWUsage:
writeMeta.writelines(str(currentLinesRead) + "\n")
writeMeta.close()
os.chmod(bwmeta, 0o600)
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [calculateBandwidth]")
return 0
@@ -148,5 +151,4 @@ class findBWUsage:
return 1
findBWUsage.startCalculations()

View File

@@ -814,12 +814,13 @@ class MailServerManagerUtils(multi.Thread):
def install_postfix_dovecot(self):
try:
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
command = 'yum remove postfix -y'
ProcessUtilities.executioner(command)
elif ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
command = 'apt-get -y remove postfix'
ProcessUtilities.executioner(command)
command = 'yum remove postfix* dovecot* -y'
ProcessUtilities.executioner(command, None, True)
elif ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20:
command = 'apt-get -y remove postfix* dovecot*'
ProcessUtilities.executioner(command, None, True)
### On Ubuntu 18 find if old dovecot and remove
@@ -827,7 +828,7 @@ class MailServerManagerUtils(multi.Thread):
try:
command = 'apt-get purge dovecot* -y'
os.system(command)
ProcessUtilities.executioner(command, None, True)
command = 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 18A348AEED409DA1'
ProcessUtilities.executioner(command)
@@ -854,14 +855,12 @@ class MailServerManagerUtils(multi.Thread):
command = 'yum install --enablerepo=gf-plus -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
elif ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/gf-release-8-11.gf.el8.noarch.rpm'
command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el8.noarch.rpm'
ProcessUtilities.executioner(command)
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
ProcessUtilities.executioner(command)
else:
import socket
command = 'apt-get install -y debconf-utils'
ProcessUtilities.executioner(command)
@@ -1038,6 +1037,9 @@ class MailServerManagerUtils(multi.Thread):
def centos_lib_dir_to_ubuntu(self, filename, old, new):
try:
#command = "sed -i 's|%s|%s|g' %s" % (old, new, filename)
#ProcessUtilities.executioner(command, None, True)
fd = open(filename, 'r')
lines = fd.readlines()
fd.close()
@@ -1101,7 +1103,7 @@ class MailServerManagerUtils(multi.Thread):
ProcessUtilities.executioner(command)
# Cleanup config files for ubuntu
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20:
self.centos_lib_dir_to_ubuntu("/usr/local/CyberCP/install/email-configs-one/master.cf", "/usr/libexec/",
"/usr/lib/")
self.centos_lib_dir_to_ubuntu("/usr/local/CyberCP/install/email-configs-one/main.cf",
@@ -1502,6 +1504,8 @@ class MailServerManagerUtils(multi.Thread):
virtualHostUtilities.issueSSLForMailServer(self.mailHostName,
'/home/%s/public_html' % (self.mailHostName))
MailServerSSLCheck = 0
from websiteFunctions.models import ChildDomains
from plogical.virtualHostUtilities import virtualHostUtilities
for websites in Websites.objects.all():
@@ -1513,6 +1517,15 @@ class MailServerManagerUtils(multi.Thread):
except:
pass
if self.MailSSL == 0 and MailServerSSLCheck == 0:
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
'Setting up Mail Server SSL as no hostname SSL found..,80')
from plogical.virtualHostUtilities import virtualHostUtilities
virtualHostUtilities.issueSSLForMailServer(websites.domain,
'/home/%s/public_html' % (websites.domain))
MailServerSSLCheck = 1
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Fixing permissions..,90')
self.fixCyberPanelPermissions()
@@ -1526,6 +1539,10 @@ class MailServerManagerUtils(multi.Thread):
def configureOpenDKIM(self):
try:
if ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
command = 'dnf install opendkim-tools -y'
ProcessUtilities.executioner(command)
## Configure OpenDKIM specific settings
openDKIMConfigurePath = "/etc/opendkim.conf"

View File

@@ -170,10 +170,11 @@ class ProcessUtilities(multi.Thread):
return ProcessUtilities.ubuntu20
return ProcessUtilities.ubuntu
else:
if open('/etc/redhat-release', 'r').read().find('CentOS Linux release 8') > -1 or open('/etc/redhat-release', 'r').read().find('AlmaLinux release 8') > -1:
if open('/etc/redhat-release', 'r').read().find('CentOS Linux release 8') > -1 or open('/etc/redhat-release', 'r').read().find('AlmaLinux release 8') > -1 or open('/etc/redhat-release', 'r').read().find('Rocky Linux release 8') > -1:
return ProcessUtilities.cent8
return ProcessUtilities.centos
@staticmethod
def containerCheck():
try:

View File

@@ -2341,6 +2341,8 @@ echo $oConfig->Save() ? 'Done' : 'Error';
if Upgrade.installedOutput.find('restic') == -1:
command = 'yum install restic -y'
Upgrade.executioner(command, 'Install Restic')
command = 'restic self-update'
Upgrade.executioner(command, 'Install Restic')
else:
if Upgrade.installedOutput.find('restic/bionic,now 0.8') == -1:
@@ -2349,6 +2351,9 @@ echo $oConfig->Save() ? 'Done' : 'Error';
command = 'apt-get install restic -y'
Upgrade.executioner(command, 'Install Restic')
command = 'restic self-update'
Upgrade.executioner(command, 'Install Restic')
@staticmethod
def UpdateMaxSSLCons():

View File

@@ -38,6 +38,10 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
var domainName = $("#domainNameInitial").text();
var domainRandomSeed = "";
$scope.currentRPath = "/";
var homeRPathBack = "/";
var homePathBack = "/home/" + domainName;
$scope.currentPath = "/home/" + domainName;
$scope.startingPath = domainName;
@@ -439,8 +443,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
var fileOrFolderNode = document.createTextNode("Folder");
fifthTDNode.appendChild(fileOrFolderNode)
}
else {
} else {
thNode.appendChild(iNodeFile);
trNode.appendChild(thNode);
trNode.addEventListener("click", function () {
@@ -472,10 +475,10 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.buttonActivator = function () {
// for restore button
if($scope.currentPath === trashPath) {
if ($scope.currentPath === trashPath) {
var restoreBTN = document.getElementById("restoreRight");
restoreBTN.style.display = "block";
}else{
} else {
var restoreBTN = document.getElementById("restoreRight");
restoreBTN.style.display = "none";
}
@@ -502,12 +505,10 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
} else if (result[0] === "php") {
aceEditorMode = "ace/mode/php";
editNotRight.style.display = "Block";
}
else if (result[0] === "py") {
} else if (result[0] === "py") {
aceEditorMode = "ace/mode/python";
editNotRight.style.display = "Block";
}
else if (result[0] === "txt") {
} else if (result[0] === "txt") {
aceEditorMode = "";
editNotRight.style.display = "Block";
} else if (result[0] === "htaccess") {
@@ -523,8 +524,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
editNode.style.pointerEvents = "none";
editNotRight.style.display = "None";
}
}
else {
} else {
var editNode = document.getElementById("editFile");
editNode.style.pointerEvents = "none";
}
@@ -631,28 +631,50 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
url = "/filemanager/controller";
var completePathToFile = "";
if (functionName === "startPoint") {
completePathToFile = $scope.currentPath;
} else if (functionName === "doubleClick") {
completePathToFile = $scope.currentPath + "/" + node.innerHTML;
} else if (functionName === "homeFetch") {
completePathToFile = homePathBack;
} else if (functionName === "goBackOnPath") {
var pos = $scope.currentPath.lastIndexOf("/");
completePathToFile = $scope.currentPath.slice(0, pos);
} else if (functionName === "refresh") {
completePathToFile = $scope.currentPath;
var rightClickNode = document.getElementById("rightClick");
} else if (functionName === "fromTree") {
completePathToFile = arguments[2];
if (domainName === "") {
if (functionName === "startPoint") {
completePathToFile = $scope.currentRPath;
} else if (functionName === "doubleClick") {
completePathToFile = $scope.currentRPath + "/" + node.innerHTML;
} else if (functionName === "homeFetch") {
completePathToFile = homeRPathBack;
} else if (functionName === "goBackOnPath") {
var pos = $scope.currentRPath.lastIndexOf("/");
completePathToFile = $scope.currentRPath.slice(0, pos);
} else if (functionName === "refresh") {
completePathToFile = $scope.currentRPath;
var rightClickNode = document.getElementById("rightClick");
} else if (functionName === "fromTree") {
completePathToFile = arguments[2];
}
$scope.currentRPath = completePathToFile;
} else {
if (functionName === "startPoint") {
completePathToFile = $scope.currentPath;
} else if (functionName === "doubleClick") {
completePathToFile = $scope.currentPath + "/" + node.innerHTML;
} else if (functionName === "homeFetch") {
completePathToFile = homePathBack;
} else if (functionName === "goBackOnPath") {
var pos = $scope.currentPath.lastIndexOf("/");
completePathToFile = $scope.currentPath.slice(0, pos);
} else if (functionName === "refresh") {
completePathToFile = $scope.currentPath;
var rightClickNode = document.getElementById("rightClick");
} else if (functionName === "fromTree") {
completePathToFile = arguments[2];
}
$scope.currentPath = completePathToFile;
}
$scope.currentPath = completePathToFile;
var data = {
completeStartingPath: completePathToFile,
method: "listForTable",
home: homePathBack,
home: "/",
domainRandomSeed: domainRandomSeed,
domainName: domainName
};
@@ -816,7 +838,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
/// code mirror open
$scope.editWithCodeMirror = function(){
$scope.editWithCodeMirror = function () {
var completePathForFile = $scope.currentPath + "/" + allFilesAndFolders[0];
var finalURL = 'https://' + window.location.hostname + ':' + window.location.port + '/filemanager/editFile?domainName=' + domainName + '&fileName=' + completePathForFile;
window.open(finalURL);
@@ -826,17 +848,32 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
// uploads
$scope.errorMessage = true;
var uploader;
if (domainName == "") {
uploader = $scope.uploader = new FileUploader({
url: "/filemanager/upload",
headers: {
'X-CSRFToken': getCookie('csrftoken') // X-CSRF-TOKEN is used for Ruby on Rails Tokens
},
formData: [{
"method": "upload",
"home": homeRPathBack
}]
});
} else {
uploader = $scope.uploader = new FileUploader({
url: "/filemanager/upload",
headers: {
'X-CSRFToken': getCookie('csrftoken') // X-CSRF-TOKEN is used for Ruby on Rails Tokens
},
formData: [{
"method": "upload",
"home": homePathBack
}]
});
}
var uploader = $scope.uploader = new FileUploader({
url: "/filemanager/upload",
headers: {
'X-CSRFToken': getCookie('csrftoken') // X-CSRF-TOKEN is used for Ruby on Rails Tokens
},
formData: [{
"method": "upload",
"home": homePathBack
}]
});
uploader.onCompleteItem = function (fileItem, response, status, headers) {
if (response.uploadStatus === 1) {
@@ -850,10 +887,16 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
};
uploader.onAfterAddingFile = function (fileItem) {
var basepath;
if (domainName == "") {
basepath = $scope.currentRPath;
} else {
basepath = $scope.currentPath
}
$scope.errorMessage = true;
fileItem.formData.push(
{
"completePath": $scope.currentPath,
"completePath": basepath,
domainRandomSeed: domainRandomSeed,
domainName: domainName
@@ -883,9 +926,14 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.createNewFolder = function () {
$scope.errorMessageFolder = true;
var completePathForFolder = $scope.currentPath + "/" + $scope.newFolderName;
var completePathForFolder;
if (domainName === "") {
completePathForFolder = $scope.currentRPath + "/" + $scope.newFolderName;
$scope.errorMessageFile = true;
} else {
completePathForFolder = $scope.currentPath + "/" + $scope.newFolderName;
$scope.errorMessageFile = true;
}
if ($scope.newFolderName.length === 0) {
$scope.errorMessageFolder = false;
@@ -951,9 +999,15 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
};
$scope.createNewFile = function () {
var completePathForFile;
if (domainName === "") {
completePathForFile = $scope.currentRPath + "/" + $scope.newFileName;
$scope.errorMessageFile = true;
} else {
completePathForFile = $scope.currentPath + "/" + $scope.newFileName;
$scope.errorMessageFile = true;
}
var completePathForFile = $scope.currentPath + "/" + $scope.newFileName;
$scope.errorMessageFile = true;
if ($scope.newFileName.length === 0) {
$scope.errorMessageFile = false;
@@ -1008,16 +1062,26 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
};
$scope.deleteFolderOrFile = function () {
var pth;
var trash;
if (domainName === "") {
pth = $scope.currentRPath;
trash = true;
} else {
pth = $scope.currentPath;
trash = $scope.skipTrash
}
$scope.deleteLoading = false;
var data = {
path: $scope.currentPath,
path: pth,
method: "deleteFolderOrFile",
fileAndFolders: allFilesAndFolders,
domainRandomSeed: domainRandomSeed,
domainName: domainName,
skipTrash: $scope.skipTrash
skipTrash: trash
};
@@ -1067,12 +1131,19 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
};
$scope.startCompression = function () {
var basepathh;
if (domainName === "") {
basepathh = $scope.currentRPath;
} else {
basepathh = $scope.currentPath;
}
$scope.compressionLoading = false;
var data = {
home: homePathBack,
basePath: $scope.currentPath,
basePath: basepathh,
listOfFiles: allFilesAndFolders,
compressedFileName: $scope.compressedFileName,
compressionType: $scope.compressionType,
@@ -1123,10 +1194,18 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.startExtraction = function () {
var pathbase;
if (domainName === "") {
pathbase = $scope.currentRPath;
} else {
pathbase = $scope.currentPath;
}
$scope.extractionLoading = false;
var basePath = $scope.currentPath;
var completeFileToExtract = $scope.currentPath + "/" + allFilesAndFolders[0];
var completeFileToExtract = pathbase + "/" + allFilesAndFolders[0];
var extractionType = "";
if (findFileExtension(completeFileToExtract) == "gz") {
@@ -1137,7 +1216,7 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
var data = {
home: homePathBack,
basePath: basePath,
basePath: pathbase,
fileToExtract: completeFileToExtract,
extractionType: extractionType,
extractionLocation: $scope.extractionLocation,
@@ -1197,11 +1276,18 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.startMoving = function () {
var basepth;
if (domainName == "") {
basepth = $scope.currentRPath;
} else {
basepth = $scope.currentPath;
}
$scope.moveLoading = false;
var data = {
home: homePathBack,
basePath: $scope.currentPath,
basePath: basepth,
newPath: $scope.pathToMoveTo,
fileAndFolders: allFilesAndFolders,
method: 'move',
@@ -1258,12 +1344,19 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.startCopying = function () {
var basepath;
if (domainName == "") {
basepath = $scope.currentRPath;
} else {
basepath = $scope.currentPath;
}
$scope.copyLoading = false;
var data = {
home: homePathBack,
basePath: $scope.currentPath,
basePath: basepath,
newPath: $scope.pathToCopyTo,
fileAndFolders: allFilesAndFolders,
method: 'copy',
@@ -1393,10 +1486,17 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
$scope.renameFile = function () {
var bpath;
if (domainName === "") {
bpath = $scope.currentRPath;
} else {
bpath = $scope.currentPath;
}
$scope.renameLoading = false;
var data = {
basePath: $scope.currentPath,
basePath: bpath,
existingName: $scope.fileToRename,
newFileName: $scope.newFileName,
method: 'rename',
@@ -1490,6 +1590,12 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
window.location.href = url + '?domainName=' + domainName + '&fileToDownload=' + downloadURL;
};
$scope.RootDownloadFile = function () {
url = "/filemanager/RootDownloadFile";
var downloadURL = $scope.currentPath + "/" + allFilesAndFolders[0];
window.location.href = url + '?fileToDownload=' + downloadURL;
};
// Change permissions
@@ -1721,4 +1827,4 @@ fileManager.controller('fileManagerCtrl', function ($scope, $http, FileUploader,
};
});
});

View File

@@ -99,3 +99,21 @@ class NormalBackupJobLogs(models.Model):
owner = models.ForeignKey(NormalBackupJobs, on_delete=models.CASCADE)
status = models.IntegerField()
message = models.TextField()
class wpplugins(models.Model):
owner = models.ForeignKey(Administrator, on_delete=models.CASCADE)
Name = models.CharField(max_length=255, default='')
config = models.TextField()
class WPSites(models.Model):
owner = models.ForeignKey(Websites, on_delete=models.CASCADE)
title = models.CharField(max_length=255, default='')
path = models.CharField(max_length=255, default='')
FinalURL = models.CharField(max_length=255, default='')
AutoUpdates = models.CharField(max_length=100, default='Disabled')
PluginUpdates = models.CharField(max_length=15, default='Disabled')
ThemeUpdates = models.CharField(max_length=15, default='Disabled')
date = models.DateTimeField(default=datetime.now)
WPLockState = models.IntegerField(default=1)

View File

@@ -20,6 +20,229 @@ function getCookie(name) {
return cookieValue;
}
var arry = []
function selectpluginJs(val) {
$('#mysearch').hide()
arry.push(val)
// console.log(arry)
document.getElementById('selJS').innerHTML = "";
for (var i = 0; i < arry.length; i++) {
$('#selJS').show()
var mlm = '<span style="background-color: #12207a; color: #FFFFFF; padding: 5px; border-radius: 30px"> ' + arry[i] + ' </span>&nbsp &nbsp'
$('#selJS').append(mlm)
}
}
var DeletePluginURL;
function DeletePluginBuucket(url) {
DeletePluginURL = url;
}
function FinalDeletePluginBuucket() {
window.location.href = DeletePluginURL;
}
var SPVal;
app.controller('WPAddNewPlugin', function ($scope, $http, $timeout, $window, $compile) {
$scope.SearchPluginName = function (val) {
SPVal = val;
url = "/websites/SearchOnkeyupPlugin";
var searchcontent = $scope.searchcontent;
var data = {
pluginname: searchcontent
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.status === 1) {
if (SPVal == 'add') {
$('#mysearch').show()
document.getElementById('mysearch').innerHTML = "";
var res = response.data.plugns.plugins
// console.log(res);
for (i = 0; i <= res.length; i++) {
//
var tml = '<option onclick="selectpluginJs(\'' + res[i].slug + '\')" style=" border-bottom: 1px solid rgba(90, 91, 92, 0.5); padding: 5px; " value="' + res[i].slug + '">' + res[i].name + '</option> <br>';
$('#mysearch').append(tml);
}
} else if (SPVal == 'eidt') {
$('#mysearch').show()
document.getElementById('mysearch').innerHTML = "";
var res = response.data.plugns.plugins
// console.log(res);
for (i = 0; i <= res.length; i++) {
//
var tml = '<option ng-click="Addplugin(\'' + res[i].slug + '\')" style=" border-bottom: 1px solid rgba(90, 91, 92, 0.5); padding: 5px; " value="' + res[i].slug + '">' + res[i].name + '</option> <br>';
var temp = $compile(tml)($scope)
angular.element(document.getElementById('mysearch')).append(temp);
}
}
} else {
// $scope.errorMessage = response.data.error_message;
alert("Status not = 1: Error..." + response.data.error_message)
}
}
function cantLoadInitialDatas(response) {
alert("Error..." + response)
}
}
$scope.AddNewplugin = function () {
url = "/websites/AddNewpluginAjax";
var bucketname = $scope.PluginbucketName
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
var data = {
config: arry,
Name: bucketname
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.status === 1) {
alert("added..........");
location.reload();
} else {
// $scope.errorMessage = response.data.error_message;
alert("Status not = 1: Error..." + response.data.error_message)
}
}
function cantLoadInitialDatas(response) {
alert("Error..." + response)
}
}
$scope.deletesPlgin = function (val) {
url = "/websites/deletesPlgin";
var data = {
pluginname: val,
pluginbBucketID: $('#pluginbID').html()
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.status === 1) {
location.reload();
} else {
// $scope.errorMessage = response.data.error_message;
alert("Status not = 1: Error..." + response.data.error_message)
}
}
function cantLoadInitialDatas(response) {
alert("Error..." + response)
}
}
$scope.Addplugin = function (slug) {
$('#mysearch').hide()
url = "/websites/Addplugineidt";
var data = {
pluginname: slug,
pluginbBucketID: $('#pluginbID').html()
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
if (response.data.status === 1) {
location.reload();
} else {
// $scope.errorMessage = response.data.error_message;
alert("Status not = 1: Error..." + response.data.error_message)
}
}
function cantLoadInitialDatas(response) {
alert("Error..." + response)
}
}
});
/* Java script code to create account */
app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
@@ -700,8 +923,9 @@ app.controller('listChildDomainsMain', function ($scope, $http, $timeout) {
}
var DeleteDomain;
$scope.deleteDomainInit = function (childDomainForDeletion){
$scope.deleteDomainInit = function (childDomainForDeletion) {
DeleteDomain = childDomainForDeletion;
};
@@ -2044,7 +2268,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
var statusFile;
$scope.WebsiteSelection = function (){
$scope.WebsiteSelection = function () {
$scope.DomainCreateForm = false;
};
@@ -2730,7 +2954,7 @@ RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
### End CyberPanel Generated Rules.
`;
const WWWToNonWWW = `### Rewrite Rules Added by CyberPanel Rewrite Rule Generator
RewriteEngine On
@@ -2757,8 +2981,7 @@ RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
$scope.rewriteRules = httpToHTTPS + $scope.rewriteRules;
} else if ($scope.rewriteTemplate === "Force NON-WWW -> WWW") {
$scope.rewriteRules = nonWWWToWWW + $scope.rewriteRules;
}
else if ($scope.rewriteTemplate === "Force WWW -> NON-WWW") {
} else if ($scope.rewriteTemplate === "Force WWW -> NON-WWW") {
$scope.rewriteRules = WWWToNonWWW + $scope.rewriteRules;
}
};

View File

@@ -0,0 +1,71 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "plugin - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container">
<div id="page-title">
<h2 id="domainNamePage">{% trans "Add New Plugin" %}
</h2>
</div>
<div ng-controller="WPAddNewPlugin" class="panel">
<div class="panel-body">
<div class="example-box-wrapper">
<form name="websiteCreationForm" action="/" id="createPackages"
class="form-horizontal bordered-row panel-body">
<label>{% trans "Plugin Bucket Name" %}</label>
<input name="PluginbucketName" type="text" class="form-control"
ng-model="PluginbucketName"
required>
<label>{% trans "Search Plugin Name" %}</label>
<input name="searchcontent" type="text" class="form-control" ng-model="searchcontent"
ng-keyup="SearchPluginName('add')"
placeholder="{% trans "Search Plugin...." %}" required>
<div id="mysearch" class="col-lg-12" style="display: none; border-top: none!important;
border: 1px solid rgba(90, 91, 92, 0.7);
position: absolute; z-index: 1;
background-color: #FFFFFF">
</div>
<h3>Selected Plugin</h3>
<div id="selJS" style="display: none; display: flex; flex-direction: row;">
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button ng-disabled="websiteCreationForm.dom.$error.required || websiteCreationForm.email.$invalid"
type="button" ng-click="AddNewplugin()"
class="btn btn-primary btn-lg">{% trans "Add Plugin Bucket" %}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,103 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "plugin - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container">
<div id="page-title">
<h2 id="domainNamePage"><h2>{% trans "Configure Plugins" %}</h2>
<a class="pull-right btn btn-primary" href="{% url "Addnewplugin" %}">{% trans "Add New Plugin" %}</a>
</h2>
</div>
<h3>List of Saved Plugins Bucket</h3>
<table class="table table-hover dataTable no-footer" id="basicTable" role="grid">
<thead style="background-color: #0a6ebd">
<tr role="row" class="plans-head">
<th style="color: #fff0ff" class="sorting_desc" tabindex="0"
aria-controls="basicTable" rowspan="1" colspan="1"
aria-sort="descending"
aria-label="Title: activate to sort column ascending">ID
</th>
<th style="color: #fff0ff" class="sorting" tabindex="0"
aria-controls="basicTable" rowspan="1" colspan="1"
aria-label="Places: activate to sort column ascending">File name
</th>
<th style="color: #fff0ff" class="sorting" tabindex="0"
aria-controls="basicTable" rowspan="1" colspan="1"
aria-label="Places: activate to sort column ascending">Action
</th>
</tr>
</thead>
<tbody>
{% for sub in Selectedplugins %}
<tr role="row" class="odd">
<td class="v-align-middle sorting_1">
<p>{{ sub.id }}</p>
</td>
<td class="v-align-middle">
<p>{{ sub.Name }}</p>
</td>
<td class="row form-group">
<div class="col">
<a href="{% url 'EidtPlugin'%}?ID={{sub.id}}"
type="button" class="btn btn-border btn-alt border-green btn-link font-green">
Edit
</a>
</div>
<div class="col">
<button
onclick="DeletePluginBuucket('{% url 'ConfigurePlugins' %}?delete={{ sub.id }}')"
data-toggle="modal"
data-target="#DeleteMember" aria-label=""
type="button" class="btn btn-border btn-alt border-red btn-link font-red">
Delete
</button>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<!------------Modal---->
<div class="modal fade stick-up" id="DeleteMember" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Deleting Plugin Bucket</h4>
</div>
<div class="modal-body">
<p>Are you sure?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
<button type="button" onclick="FinalDeletePluginBuucket()" class="btn btn-primary">Yes</button>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,206 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "Create New WordPress - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container">
<div id="page-title">
<h2>{% trans "Create Wordpress Site" %}</h2>
<p>{% trans "On this page you can launch, list, modify and delete websites from your server." %}</p>
</div>
<div ng-controller="createWebsite" class="panel">
<div class="panel-body">
<h3 class="content-box-header">
{% trans "Website Details" %} <img ng-hide="webSiteCreationLoading"
src="{% static 'images/loading.gif' %}">
</h3>
<div class="example-box-wrapper">
<form name="websiteCreationForm" action="/" id="createPackages"
class="form-horizontal bordered-row panel-body">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Package" %}</label>
<div class="col-sm-6">
<select ng-model="packageForWebsite" class="form-control">
{% for items in packageList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Owner" %}</label>
<div class="col-sm-6">
<select ng-model="websiteOwner" class="form-control">
{% for items in owernList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Title" %}</label>
<div class="col-sm-6">
<input type="text" name="WPtitle" class="form-control" ng-model="WPtitle" required>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>
<div class="col-sm-6">
<input name="dom" type="text" class="form-control" ng-model="domainNameCreate"
placeholder="{% trans "Do not enter WWW, it will be auto created!" %}" required>
</div>
<div ng-show="websiteCreationForm.dom.$error.pattern"
class="current-pack">{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Username" %}</label>
<div class="col-sm-6">
<input name="Username" type="text" class="form-control" ng-model="WPUsername"
required>
</div>
<div ng-show="websiteCreationForm.dom.$error.pattern"
class="current-pack">{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Email" %}</label>
<div class="col-sm-6">
<input type="email" name="email" class="form-control" ng-model="adminEmail" required>
</div>
<div ng-show="websiteCreationForm.email.$error.email"
class="current-pack">{% trans "Invalid Email" %}</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Password" %}</label>
<div class="col-sm-6">
<input name="password" type="password" class="form-control" ng-model="WPPassword"
required>
</div>
<div ng-show="websiteCreationForm.dom.$error.pattern"
class="current-pack">{% trans "Invalid Domain (Note: You don't need to add 'http' or 'https')" %}</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select WP Version" %}</label>
<div class="col-sm-6">
<select ng-model="phpSelection" class="form-control">
{% for php in WPVersions %}
<option>{{ php }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Additional Features" %}</label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input ng-model="sslCheck" type="checkbox" value="">
SSL
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input ng-model="dkimCheck" type="checkbox" value="">
DKIM Support
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input ng-model="openBasedir" type="checkbox" value="">
open_basedir Protection
</label>
</div>
</div>
<label class="col-sm-3 control-label"></label>
<div class="col-sm-9">
<div class="checkbox">
<label>
<input ng-model="mailDomain" type="checkbox" value="">
Create Mail Domain
</label>
</div>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button ng-disabled="websiteCreationForm.dom.$error.required || websiteCreationForm.email.$invalid"
type="button" ng-click="createWebsite()"
class="btn btn-primary btn-lg">{% trans "Create Website" %}</button>
</div>
</div>
<div ng-hide="installationProgress" class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-7">
<div class="alert alert-success text-center">
<h2>{$ currentStatus $}</h2>
</div>
<div class="progress">
<div id="installProgress" class="progress-bar" role="progressbar" aria-valuenow="70"
aria-valuemin="0" aria-valuemax="100" style="width:0%">
<span class="sr-only">70% Complete</span>
</div>
</div>
<div ng-hide="errorMessageBox" class="alert alert-danger">
<p>{% trans "Error message:" %} {$ errorMessage $}</p>
</div>
<div ng-hide="success" class="alert alert-success">
<p>{% trans "Website succesfully created." %}</p>
</div>
<div ng-hide="couldNotConnect" class="alert alert-danger">
<p>{% trans "Could not connect to server. Please refresh this page." %}</p>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button type="button" ng-disabled="goBackDisable" ng-click="goBack()"
class="btn btn-primary btn-lg">{% trans "Go Back" %}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -0,0 +1,81 @@
{% extends "baseTemplate/index.html" %}
{% load i18n %}
{% block title %}{% trans "plugin - CyberPanel" %}{% endblock %}
{% block content %}
{% load static %}
{% get_current_language as LANGUAGE_CODE %}
<!-- Current language: {{ LANGUAGE_CODE }} -->
<div class="container">
<span id="pluginbID" style="display: none">{{ pluginbID }}</span>
<div id="page-title">
<h2 id="domainNamePage">{% trans "Eidt Plugin Bucket" %}
</h2>
</div>
<div ng-controller="WPAddNewPlugin" class="panel">
<div class="panel-body">
<div class="example-box-wrapper">
<form name="websiteCreationForm" action="/" id="createPackages"
class="form-horizontal bordered-row panel-body">
<label>{% trans "Search Plugin Name" %}</label>
<input name="searchcontent" type="text" class="form-control" ng-model="searchcontent"
ng-keyup="SearchPluginName('eidt')"
placeholder="{% trans "Search Plugin...." %}" required>
<div id="mysearch" class="col-lg-12" style="display: none; border-top: none!important;
border: 1px solid rgba(90, 91, 92, 0.7);
position: absolute; z-index: 1;
background-color: #FFFFFF">
</div>
<h3>Selected Plugin</h3>
<div id="sedplugn" style=" display: flex; flex-direction: row;">
{% for plugin in Selectedplugins %}
<div id="selplug"
style="background-color: #12207a; color: #FFFFFF; padding: 5px; border-radius: 30px">
{{plugin}}
<svg ng-click="deletesPlgin('{{plugin}}')" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"
role="img" width="1em" height="1em"
preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16">
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
stroke-width="1.5" d="m11.25 4.75l-6.5 6.5m0-6.5l6.5 6.5"/>
</svg>
</div>
&nbsp &nbsp
{% endfor %}
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button ng-disabled="websiteCreationForm.dom.$error.required || websiteCreationForm.email.$invalid"
type="button" ng-click="AddNewplugin()"
class="btn btn-primary btn-lg">{% trans "Add Plugin Bucket" %}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@@ -41,234 +41,223 @@
style="padding: 0px; box-shadow: 0px 0px 1px 0px #888888;">
<div class="">
<div class="table-responsive no-gutter text-nowrap" style="overflow-x: hidden;">
<div style="background-image: url('https://cdn.statically.io/screenshot/{$ web.domain $}?fullPage=true');;
height: 160px;
width: 200px;
background-position: top;
background-repeat: no-repeat;
background-size: cover;
position: relative;" class="col-lg-3 col-md-12">
<div style="border-bottom: 1px solid #888888" class="col-md-12">
<div class="col-lg-10 content-box-header" style="text-transform: none;">
<a href="http://{$ web.domain $}" target="_blank" title="Visit Site">
<h2 style="display: inline; color: #414C59;" ng-bind="web.domain"></h2>
</a>
<a target="_blank" href="/filemanager/{$ web.masterDomain $}" title="Open File Manager">
--
File Manager</a>
</div>
<div class="col-md-2 content-box-header" style="text-transform: none;">
<a href="/websites/{$ web.masterDomain $}/{$ web.domain $}" target="_blank"
title="Manage Website">
<i class="p fa fa-external-link btn-icon">&emsp;</i>
<span>Manage</span>
</a>
</div>
</div>
<div class="col-lg-9" style="text-transform: none">
<div style="border-bottom: 1px solid #888888" class="col-md-12">
<div class="col-lg-10 content-box-header" style="text-transform: none;">
<a href="http://{$ web.domain $}" target="_blank" title="Visit Site">
<h2 style="display: inline; color: #414C59;" ng-bind="web.domain"></h2>
</a>
<a target="_blank" href="/filemanager/{$ web.masterDomain $}" title="Open File Manager">
--
File Manager</a>
</div>
<div class="col-md-2 content-box-header" style="text-transform: none;">
<a href="/websites/{$ web.masterDomain $}/{$ web.domain $}" target="_blank"
title="Manage Website">
<i class="p fa fa-external-link btn-icon">&emsp;</i>
<span>Manage</span>
</a>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4 content-box-header">
<i class="p fa fa-trash-o btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Delete Child Domain">&emsp;</i>
<span><a ng-click='deleteDomainInit(web.domain)' data-toggle="modal" data-target="#DeleteChild" href=""
style="text-transform: none">Delete</a></span>
<div id="DeleteChild" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;
</button>
<h4 class="modal-title">Delete Child Domain
<img ng-hide="$parent.cyberPanelLoading"
src="/static/images/loading.gif"
style="display: none;">
</h4>
</div>
<div class="modal-body">
<form name="DeleteDocumentRootForm" action="/" class="form-horizontal">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-2 control-label">{% trans "" %}</label>
<div class="col-sm-8">
<input ng-model="$parent.DeleteDocRoot" type="checkbox" value="">
Delete Document Root
</div>
<div class="col-md-12">
<div class="col-md-4 content-box-header">
<i class="p fa fa-trash-o btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Delete Child Domain">&emsp;</i>
<span><a ng-click='deleteDomainInit(web.domain)' data-toggle="modal" data-target="#DeleteChild" href=""
style="text-transform: none">Delete</a></span>
<div id="DeleteChild" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;
</button>
<h4 class="modal-title">Delete Child Domain
<img ng-hide="$parent.cyberPanelLoading"
src="/static/images/loading.gif"
style="display: none;">
</h4>
</div>
<div class="modal-body">
<form name="DeleteDocumentRootForm" action="/" class="form-horizontal">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-2 control-label">{% trans "" %}</label>
<div class="col-sm-8">
<input ng-model="$parent.DeleteDocRoot" type="checkbox" value="">
Delete Document Root
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary"
ng-click="deleteChildDomain()">Delete Now
</button>
<button type="button" ng-disabled="savingSettings"
class="btn btn-default" data-dismiss="modal">
Close
</button>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary"
ng-click="deleteChildDomain()">Delete Now
</button>
<button type="button" ng-disabled="savingSettings"
class="btn btn-default" data-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-map-marker btn-icon text-muted" data-toggle="tooltip"
data-placement="right" title="IP Address">&emsp;</i>
<span ng-bind="web.ipAddress"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-lock btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="SSL">&emsp;</i>
<span><a ng-click="issueSSL(web.domain)" href=""
style="text-transform: none">Issue SSL</a></span>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4 content-box-header">
<i class="p fa fa-map-marker btn-icon text-muted" data-toggle="tooltip"
data-placement="right" title="IP Address">&emsp;</i>
<span ng-bind="web.ipAddress"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-lock btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="SSL">&emsp;</i>
<span><a ng-click="issueSSL(web.domain)" href=""
style="text-transform: none">Issue SSL</a></span>
</div>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-cubes btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Packages">&emsp;</i>
<span ng-bind="web.package" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-user btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="Owner">&emsp;</i>
<span ng-bind="web.admin" style="text-transform: none"></span>
</div>
<div class="col-md-12">
<div class="col-md-4 content-box-header">
<i class="p fa fa-cubes btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Packages">&emsp;</i>
<span ng-bind="web.package" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-user btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="Owner">&emsp;</i>
<span ng-bind="web.admin" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-arrows-h btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Convert to Website">&emsp;</i>
<span><a data-toggle="modal" data-target="#settings" href=""
style="text-transform: none" ng-click="initConvert(web.domain)">Convert to Website</a></span>
<div id="settings" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="col-md-4 content-box-header">
<i class="p fa fa-arrows-h btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Convert to Website">&emsp;</i>
<span><a data-toggle="modal" data-target="#settings" href=""
style="text-transform: none" ng-click="initConvert(web.domain)">Convert to Website</a></span>
<div id="settings" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;
</button>
<h4 class="modal-title">Convert Child Domain to normal Website
<img ng-hide="$parent.cyberPanelLoading"
src="/static/images/loading.gif"
style="display: none;">
</h4>
</div>
<div class="modal-body">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;
</button>
<h4 class="modal-title">Convert Child Domain to normal Website
<img ng-hide="$parent.cyberPanelLoading"
src="/static/images/loading.gif"
style="display: none;">
</h4>
</div>
<div class="modal-body">
<form name="containerSettingsForm" action="/" class="form-horizontal">
<form name="containerSettingsForm" action="/" class="form-horizontal">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>
<div class="col-sm-6">
<input name="dom" type="text" class="form-control"
ng-model="domainName"
placeholder="{% trans "Do not enter WWW, it will be auto created!" %}"
readonly>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Domain Name" %}</label>
<div class="col-sm-6">
<input name="dom" type="text" class="form-control"
ng-model="domainName"
placeholder="{% trans "Do not enter WWW, it will be auto created!" %}"
readonly>
</div>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Owner" %}</label>
<div class="col-sm-6">
<select ng-model="$parent.websiteOwner"
class="form-control">
{% for items in owernList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Owner" %}</label>
<div class="col-sm-6">
<select ng-model="$parent.websiteOwner"
class="form-control">
{% for items in owernList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<hr ng-hide="installationDetailsForm">
<hr ng-hide="installationDetailsForm">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Package" %}</label>
<div class="col-sm-6">
<select ng-model="$parent.packageForWebsite"
class="form-control">
{% for items in packageList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select Package" %}</label>
<div class="col-sm-6">
<select ng-model="$parent.packageForWebsite"
class="form-control">
{% for items in packageList %}
<option>{{ items }}</option>
{% endfor %}
</select>
</div>
</div>
<hr ng-hide="installationDetailsForm">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Email" %}</label>
<div class="col-sm-6">
<input type="email" name="email" class="form-control"
ng-model="$parent.adminEmail" required>
</div>
<hr ng-hide="installationDetailsForm">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Email" %}</label>
<div class="col-sm-6">
<input type="email" name="email" class="form-control"
ng-model="$parent.adminEmail" required>
</div>
</div>
<hr ng-hide="installationDetailsForm">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select PHP" %}</label>
<div class="col-sm-6">
<select ng-model="$parent.phpSelection"
class="form-control">
{% for php in phps %}
<option>{{ php }}</option>
{% endfor %}
</select>
</div>
<hr ng-hide="installationDetailsForm">
<div ng-hide="installationDetailsForm" class="form-group">
<label class="col-sm-3 control-label">{% trans "Select PHP" %}</label>
<div class="col-sm-6">
<select ng-model="$parent.phpSelection"
class="form-control">
{% for php in phps %}
<option>{{ php }}</option>
{% endfor %}
</select>
</div>
</div>
<div ng-hide="installationProgress" class="form-group">
<label class="col-sm-1 control-label"></label>
<div class="col-sm-10">
<div ng-hide="installationProgress" class="form-group">
<label class="col-sm-1 control-label"></label>
<div class="col-sm-10">
<div class="alert alert-success text-center">
<h2>{$ currentStatus $}</h2>
<div class="alert alert-success text-center">
<h2>{$ currentStatus $}</h2>
</div>
<div class="progress">
<div id="installProgress" class="progress-bar"
role="progressbar" aria-valuenow="70"
aria-valuemin="0" aria-valuemax="100"
style="width:0%">
<span class="sr-only">70% Complete</span>
</div>
<div class="progress">
<div id="installProgress" class="progress-bar"
role="progressbar" aria-valuenow="70"
aria-valuemin="0" aria-valuemax="100"
style="width:0%">
<span class="sr-only">70% Complete</span>
</div>
</div>
</div>
</div>
</div>
<div ng-hide="installationProgress" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button type="button" ng-disabled="goBackDisable"
ng-click="goBack()"
class="btn btn-primary btn-lg">{% trans "Go Back" %}</button>
</div>
<div ng-hide="installationProgress" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button type="button" ng-disabled="goBackDisable"
ng-click="goBack()"
class="btn btn-primary btn-lg">{% trans "Go Back" %}</button>
</div>
</div>
</form>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary"
ng-click="convert()">Convert
</button>
<button type="button" ng-disabled="savingSettings"
class="btn btn-default" data-dismiss="modal">
Close
</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary"
ng-click="convert()">Convert
</button>
<button type="button" ng-disabled="savingSettings"
class="btn btn-default" data-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="listFail" class="alert alert-danger">

View File

@@ -43,71 +43,62 @@
style="padding: 0px; box-shadow: 0px 0px 1px 0px #888888;">
<div class="">
<div class="table-responsive no-gutter text-nowrap" style="overflow-x: hidden;">
<div style="background-image: url('https://cdn.statically.io/screenshot/{$ web.domain $}?fullPage=true');
height: 160px;
width: 200px;
background-position: top;
background-repeat: no-repeat;
background-size: cover;
position: relative;"
class="col-lg-3 col-md-12">
<div style="border-bottom: 1px solid #888888" class="col-md-12">
<div class="col-lg-10 content-box-header" style="text-transform: none;">
<a href="http://{$ web.domain $}" target="_blank" title="Visit Site">
<h2 style="display: inline; color: #414C59;" ng-bind="web.domain"></h2>
</a>
<a target="_self" href="/filemanager/{$ web.domain $}" title="Open File Manager"> --
{% trans "File Manager" %}</a>
</div>
<div class="col-md-2 content-box-header" style="text-transform: none;">
<a href="/websites/{$ web.domain $}" target="_self" title="Manage Website">
<i class="p fa fa-external-link btn-icon">&emsp;</i>
<span>{% trans "Manage" %}</span>
</a>
</div>
</div>
<div class="col-lg-9" style="text-transform: none">
<div style="border-bottom: 1px solid #888888" class="col-md-12">
<div class="col-lg-10 content-box-header" style="text-transform: none;">
<a href="http://{$ web.domain $}" target="_blank" title="Visit Site">
<h2 style="display: inline; color: #414C59;" ng-bind="web.domain"></h2>
</a>
<a target="_self" href="/filemanager/{$ web.domain $}" title="Open File Manager"> --
{% trans "File Manager" %}</a>
</div>
<div class="col-md-2 content-box-header" style="text-transform: none;">
<a href="/websites/{$ web.domain $}" target="_self" title="Manage Website">
<i class="p fa fa-external-link btn-icon">&emsp;</i>
<span>{% trans "Manage" %}</span>
</a>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4 content-box-header">
<i class="p fa fa-sticky-note btn-icon text-muted" data-toggle="tooltip"
data-placement="right" title="State">&emsp;</i>
<span ng-bind="web.state" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-map-marker btn-icon text-muted" data-toggle="tooltip"
data-placement="right" title="IP Address">&emsp;</i>
<span ng-bind="web.ipAddress"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-lock btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="SSL">&emsp;</i>
<span><a ng-click="issueSSL(web.domain)" href=""
style="text-transform: none">{% trans "Issue SSL" %}</a></span>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4 content-box-header">
<i class="p fa fa-hdd-o btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Disk Usage">&emsp;</i>
<span ng-bind="web.diskUsed" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-cubes btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Packages">&emsp;</i>
<span ng-bind="web.package" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-user btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="Owner">&emsp;</i>
<span ng-bind="web.admin" style="text-transform: none"></span>
</div>
<div class="col-md-12">
<div class="col-md-4 content-box-header">
<i class="p fa fa-sticky-note btn-icon text-muted" data-toggle="tooltip"
data-placement="right" title="State">&emsp;</i>
<span ng-bind="web.state" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-map-marker btn-icon text-muted" data-toggle="tooltip"
data-placement="right" title="IP Address">&emsp;</i>
<span ng-bind="web.ipAddress"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-lock btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="SSL">&emsp;</i>
<span><a ng-click="issueSSL(web.domain)" href=""
style="text-transform: none">{% trans "Issue SSL" %}</a></span>
</div>
</div>
<div class="col-md-12">
<div class="col-md-4 content-box-header">
<i class="p fa fa-hdd-o btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Disk Usage">&emsp;</i>
<span ng-bind="web.diskUsed" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-cubes btn-icon text-muted" data-toggle="tooltip"
data-placement="right"
title="Packages">&emsp;</i>
<span ng-bind="web.package" style="text-transform: none"></span>
</div>
<div class="col-md-4 content-box-header">
<i class="p fa fa-user btn-icon text-muted" data-toggle="tooltip" data-placement="right"
title="Owner">&emsp;</i>
<span ng-bind="web.admin" style="text-transform: none"></span>
</div>
</div>
<!--table cellpadding="0" cellspacing="0" border="0" class="table" style="margin:0px 0px; id="datatable-example">
<thead>
<tr>
@@ -130,8 +121,6 @@
</tbody>
</table-->
</div>
<div id="listFail" class="alert alert-danger">
<p>{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}</p>
</div>

View File

@@ -16,6 +16,21 @@ urlpatterns = [
url(r'^CreateNewDomain$', views.CreateNewDomain, name='CreateNewDomain'),
### WordPress
url(r'^createWordpress$', views.WPCreate, name='createWordpress'),
#### AddPlugin
url(r'^ConfigurePlugins$', views.ConfigurePlugins, name='ConfigurePlugins'),
url(r'^Addnewplugin$', views.Addnewplugin, name='Addnewplugin'),
url(r'^EidtPlugin$', views.EidtPlugin, name='EidtPlugin'),
## AddPlugin Ajax
url(r'^SearchOnkeyupPlugin$', views.SearchOnkeyupPlugin, name='SearchOnkeyupPlugin'),
url(r'^AddNewpluginAjax$', views.AddNewpluginAjax, name='AddNewpluginAjax'),
url(r'^deletesPlgin', views.deletesPlgin, name='deletesPlgin'),
url(r'^Addplugineidt', views.Addplugineidt, name='Addplugineidt'),
# Website modification url

View File

@@ -6,8 +6,11 @@ from django.http import HttpResponse
from loginSystem.models import Administrator
from loginSystem.views import loadLoginPage
import json
import plogical.CyberCPLogFileWriter as logging
from plogical.httpProc import httpProc
from websiteFunctions.models import wpplugins
from websiteFunctions.website import WebsiteManager
from websiteFunctions.pluginManager import pluginManager
from django.views.decorators.csrf import csrf_exempt
@@ -26,6 +29,138 @@ def createWebsite(request):
return wm.createWebsite(request, userID)
except KeyError:
return redirect(loadLoginPage)
def WPCreate(request):
try:
userID = request.session['userID']
wm = WebsiteManager()
return wm.WPCreate(request, userID)
except KeyError:
return redirect(loadLoginPage)
def ConfigurePlugins(request):
try:
userID = request.session['userID']
userobj = Administrator.objects.get(pk=userID)
DeleteFileID = request.GET.get('delete', None)
if DeleteFileID != None:
try:
jobobj = wpplugins.objects.get(pk=DeleteFileID, owner=userobj)
jobobj.delete()
Deleted = 1
except BaseException as msg:
logging.CyberCPLogFileWriter.writeToFile("DeleteFileID ....... %s....msg.....%s" % (DeleteFileID,msg))
Deleted = 0
wm = WebsiteManager()
return wm.ConfigurePlugins(request, userID)
except KeyError:
return redirect(loadLoginPage)
def Addnewplugin(request):
try:
userID = request.session['userID']
wm = WebsiteManager()
return wm.Addnewplugin(request, userID)
except KeyError:
return redirect(loadLoginPage)
def SearchOnkeyupPlugin(request):
try:
userID = request.session['userID']
result = pluginManager.preWebsiteCreation(request)
if result != 200:
return result
wm = WebsiteManager()
coreResult = wm.SearchOnkeyupPlugin(userID, json.loads(request.body))
result = pluginManager.postWebsiteCreation(request, coreResult)
if result != 200:
return result
return coreResult
except KeyError:
return redirect(loadLoginPage)
def AddNewpluginAjax(request):
try:
userID = request.session['userID']
result = pluginManager.preWebsiteCreation(request)
if result != 200:
return result
wm = WebsiteManager()
coreResult = wm.AddNewpluginAjax(userID, json.loads(request.body))
result = pluginManager.postWebsiteCreation(request, coreResult)
if result != 200:
return result
return coreResult
except KeyError:
return redirect(loadLoginPage)
def EidtPlugin(request):
try:
userID = request.session['userID']
pluginbID = request.GET.get('ID')
wm = WebsiteManager()
return wm.EidtPlugin(request, userID, pluginbID)
except KeyError:
return redirect(loadLoginPage)
def deletesPlgin(request):
try:
userID = request.session['userID']
result = pluginManager.preWebsiteCreation(request)
if result != 200:
return result
wm = WebsiteManager()
coreResult = wm.deletesPlgin(userID, json.loads(request.body))
result = pluginManager.postWebsiteCreation(request, coreResult)
if result != 200:
return result
return coreResult
except KeyError:
return redirect(loadLoginPage)
def Addplugineidt(request):
try:
userID = request.session['userID']
result = pluginManager.preWebsiteCreation(request)
if result != 200:
return result
wm = WebsiteManager()
coreResult = wm.Addplugineidt(userID, json.loads(request.body))
result = pluginManager.postWebsiteCreation(request, coreResult)
if result != 200:
return result
return coreResult
except KeyError:
return redirect(loadLoginPage)
def modifyWebsite(request):
try:

View File

@@ -12,7 +12,7 @@ django.setup()
import json
from plogical.acl import ACLManager
import plogical.CyberCPLogFileWriter as logging
from websiteFunctions.models import Websites, ChildDomains, GitLogs
from websiteFunctions.models import Websites, ChildDomains, GitLogs, wpplugins
from plogical.virtualHostUtilities import virtualHostUtilities
import subprocess
import shlex
@@ -59,6 +59,203 @@ class WebsiteManager:
Data, 'createWebsite')
return proc.render()
def WPCreate(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
adminNames = ACLManager.loadAllUsers(userID)
packagesName = ACLManager.loadPackages(userID, currentACL)
phps = PHPManager.findPHPVersions()
FinalVersions = []
#logging.CyberCPLogFileWriter.writeToFile("jassssssssss...............")
counter = 0
try:
import requests
WPVersions = json.loads(requests.get('https://api.wordpress.org/core/version-check/1.7/').text)['offers']
for versions in WPVersions:
if counter == 7:
break
if versions['current'] not in FinalVersions:
FinalVersions.append(versions['current'])
counter = counter + 1
except:
FinalVersions = ['5.6', '5.5.3', '5.5.2']
# logging.CyberCPLogFileWriter.writeToFile("FinalVersions:%s"+str(FinalVersions))
Data = {'packageList': packagesName, "owernList": adminNames, 'phps': phps, 'WPVersions': FinalVersions}
proc = httpProc(request, 'websiteFunctions/WPCreate.html',
Data, 'createWebsite')
return proc.render()
def ConfigurePlugins(self, request=None, userID=None, data=None):
DataPass ={}
currentACL = ACLManager.loadedACL(userID)
adminNames = ACLManager.loadAllUsers(userID)
packagesName = ACLManager.loadPackages(userID, currentACL)
phps = PHPManager.findPHPVersions()
userobj = Administrator.objects.get(pk=userID)
Selectedplugins = wpplugins.objects.filter(owner = userobj)
#data['Selectedplugins'] = wpplugins.objects.filter(ProjectOwner=HostingCompany)
Data = {'packageList': packagesName, "owernList": adminNames, 'phps': phps, 'Selectedplugins' : Selectedplugins,}
proc = httpProc(request, 'websiteFunctions/WPConfigurePlugins.html',
Data, 'createWebsite')
return proc.render()
def Addnewplugin(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
adminNames = ACLManager.loadAllUsers(userID)
packagesName = ACLManager.loadPackages(userID, currentACL)
phps = PHPManager.findPHPVersions()
Data = {'packageList': packagesName, "owernList": adminNames, 'phps': phps}
proc = httpProc(request, 'websiteFunctions/WPAddNewPlugin.html',
Data, 'createWebsite')
return proc.render()
def SearchOnkeyupPlugin(self, userID=None, data=None):
try:
currentACL = ACLManager.loadedACL(userID)
pluginname = data['pluginname']
# logging.CyberCPLogFileWriter.writeToFile("Plugin Name ....... %s"%pluginname)
url = "http://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[search]=%s" % str(pluginname)
import requests
res = requests.get(url)
r = res.json()
# return proc.ajax(1, 'Done', {'plugins': r})
data_ret = {'status': 1,'plugns': r,}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except BaseException as msg:
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def AddNewpluginAjax(self, userID=None, data=None):
try:
currentACL = ACLManager.loadedACL(userID)
userobj = Administrator.objects.get(pk=userID)
config = data['config']
Name = data['Name']
# pluginname = data['pluginname']
# logging.CyberCPLogFileWriter.writeToFile("config ....... %s"%config)
# logging.CyberCPLogFileWriter.writeToFile(" Name ....... %s"%Name)
addpl = wpplugins(Name=Name, config=json.dumps(config), owner=userobj)
addpl.save()
data_ret = {'status': 1}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except BaseException as msg:
data_ret = {'status': 0, 'AddNewpluginAjax': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def EidtPlugin(self,request=None, userID=None, pluginbID=None):
Data ={}
currentACL = ACLManager.loadedACL(userID)
pluginobj = wpplugins.objects.get(pk=pluginbID)
lmo = json.loads(pluginobj.config)
Data['Selectedplugins'] = lmo
Data['pluginbID'] = pluginbID
proc = httpProc(request, 'websiteFunctions/WPEidtPlugin.html',
Data, 'createWebsite')
return proc.render()
def deletesPlgin(self, userID=None, data=None,):
try:
currentACL = ACLManager.loadedACL(userID)
userobj = Administrator.objects.get(pk=userID)
pluginname = data['pluginname']
pluginbBucketID = data['pluginbBucketID']
# logging.CyberCPLogFileWriter.writeToFile("pluginbID ....... %s" % pluginbBucketID)
# logging.CyberCPLogFileWriter.writeToFile("pluginname ....... %s" % pluginname)
obj = wpplugins.objects.get(pk=pluginbBucketID, owner=userobj)
ab = []
ab = json.loads(obj.config)
ab.remove(pluginname)
obj.config = json.dumps(ab)
obj.save()
data_ret = {'status': 1}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except BaseException as msg:
data_ret = {'status': 0, 'deletesPlgin': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def Addplugineidt(self, userID=None, data=None,):
try:
currentACL = ACLManager.loadedACL(userID)
userobj = Administrator.objects.get(pk=userID)
pluginname = data['pluginname']
pluginbBucketID = data['pluginbBucketID']
#logging.CyberCPLogFileWriter.writeToFile("pluginbID ....... %s" % pluginbBucketID)
#logging.CyberCPLogFileWriter.writeToFile("pluginname ....... %s" % pluginname)
pObj = wpplugins.objects.get(pk=pluginbBucketID, owner=userobj)
listofplugin = json.loads(pObj.config)
try:
index = listofplugin.index(pluginname)
print('index.....%s' % index)
if (index >= 0):
data_ret = {'status': 0, 'deletesPlgin': 0, 'error_message': str('Already Save in your Plugin lis')}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except:
ab = []
ab = json.loads(pObj.config)
ab.append(pluginname)
pObj.config = json.dumps(ab)
pObj.save()
data_ret = {'status': 1}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except BaseException as msg:
data_ret = {'status': 0, 'deletesPlgin': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
def modifyWebsite(self, request=None, userID=None, data=None):
currentACL = ACLManager.loadedACL(userID)
@@ -1844,7 +2041,6 @@ class WebsiteManager:
json_data = json.dumps(data_ret)
return HttpResponse(json_data)
except BaseException as msg:
data_ret = {'status': 0, 'installStatus': 0, 'error_message': str(msg)}
json_data = json.dumps(data_ret)