mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
wpdone
This commit is contained in:
@@ -395,18 +395,18 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="{% url 'loadWebsitesHome' %}" title="{% trans 'WordPress' %}">
|
<a href="{% url 'loadWebsitesHome' %}" title="{% trans 'WordPress' %}">
|
||||||
<div class="glyph-icon icon-wordpress" title="{% trans 'WordPress' %}"></div>
|
<div class="glyph-icon icon-wordpress" title="{% trans 'WordPress' %}"></div>
|
||||||
<span>{% trans "Wordpresss" %}</span>
|
<span>{% trans "WordPresss" %}</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="sidebar-submenu">
|
<div class="sidebar-submenu">
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% if admin or createWebsite %}
|
{% if admin or createWebsite %}
|
||||||
<li><a href="{% url 'createWordpress' %}"
|
<li><a href="{% url 'createWordpress' %}"
|
||||||
title="{% trans 'Create Worpress' %}"><span>{% trans "Create Worpress" %}</span></a>
|
title="{% trans 'Deploy WordPress' %}"><span>{% trans "Deploy WordPress" %}</span></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li><a href="{% url 'ListWPSites' %}"
|
<li><a href="{% url 'ListWPSites' %}"
|
||||||
title="{% trans 'List Websites' %}"><span>{% trans "List Worpress" %}</span></a>
|
title="{% trans 'List WordPress' %}"><span>{% trans "List WordPress" %}</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="{% url 'ConfigurePlugins' %}"
|
<li><a href="{% url 'ConfigurePlugins' %}"
|
||||||
title="{% trans 'ConfigurePlugins' %}"><span>{% trans "Configure Plugins" %}</span></a>
|
title="{% trans 'ConfigurePlugins' %}"><span>{% trans "Configure Plugins" %}</span></a>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ django.setup()
|
|||||||
import threading as multi
|
import threading as multi
|
||||||
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
|
||||||
import subprocess
|
import subprocess
|
||||||
from websiteFunctions.models import ChildDomains, Websites, WPSites, WPStaging
|
from websiteFunctions.models import ChildDomains, Websites, WPSites, WPStaging, wpplugins
|
||||||
from plogical import randomPassword
|
from plogical import randomPassword
|
||||||
from plogical.mysqlUtilities import mysqlUtilities
|
from plogical.mysqlUtilities import mysqlUtilities
|
||||||
from databases.models import Databases
|
from databases.models import Databases
|
||||||
@@ -729,6 +729,31 @@ $parameters = array(
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
############## Install Save Plugin Buckets
|
||||||
|
try:
|
||||||
|
logging.writeToFile("plugin bucket list start")
|
||||||
|
logging.writeToFile("plugin bucket list: %s" % str(self.extraArgs['AllPluginsList']))
|
||||||
|
logging.writeToFile("plugin bucket saved: %s" % str(self.extraArgs['SavedPlugins']))
|
||||||
|
if self.extraArgs['SavedPlugins'] == True:
|
||||||
|
AllPluginList= self.extraArgs['AllPluginsList']
|
||||||
|
for i in range(len(AllPluginList)):
|
||||||
|
# command = "wp plugin install " + AllPluginList[i]+ "--allow-root --path=" + finalPath
|
||||||
|
command = "wp plugin install %s --allow-root --path=%s" %(AllPluginList[i], finalPath)
|
||||||
|
result = ProcessUtilities.outputExecutioner(command, externalApp)
|
||||||
|
|
||||||
|
if result.find('Success:') == -1:
|
||||||
|
raise BaseException(result)
|
||||||
|
|
||||||
|
command = "wp plugin activate %s --allow-root --path=%s" %(AllPluginList[i], finalPath)
|
||||||
|
result = ProcessUtilities.outputExecutioner(command, externalApp)
|
||||||
|
except BaseException as msg:
|
||||||
|
logging.writeToFile("Error in istall plugin bucket: %s"%str(msg))
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
||||||
# from filemanager.filemanager import FileManager
|
# from filemanager.filemanager import FileManager
|
||||||
@@ -1689,11 +1714,33 @@ $parameters = array(
|
|||||||
statusFile.writelines('Installing WordPress....,30')
|
statusFile.writelines('Installing WordPress....,30')
|
||||||
statusFile.close()
|
statusFile.close()
|
||||||
|
|
||||||
## Install WordPress
|
logging.writeToFile("Pluginbucket ....... %s" % str(self.data['pluginbucket']))
|
||||||
|
|
||||||
|
|
||||||
|
## Install WordPress
|
||||||
|
## get save pluginbucket
|
||||||
|
|
||||||
|
###Get save plugin
|
||||||
|
SavedPlugins = False
|
||||||
|
AllPluginsList = []
|
||||||
|
try:
|
||||||
|
if(self.data['pluginbucket'] != 1):
|
||||||
|
bucktobj = wpplugins.objects.get(pk=self.data['pluginbucket'])
|
||||||
|
pluginlistt = json.loads(bucktobj.config)
|
||||||
|
SavedPlugins = True
|
||||||
|
for i in range(len(pluginlistt)):
|
||||||
|
AllPluginsList.append(pluginlistt[i])
|
||||||
|
except BaseException as msg:
|
||||||
|
logging.writeToFile("Error in Get save plugin ....... %s" % str(msg))
|
||||||
|
pass
|
||||||
|
|
||||||
|
logging.writeToFile("AllPluginsList 1 ....... %s" % str(AllPluginsList))
|
||||||
|
logging.writeToFile("SavedPlugins 1 ....... %s" % str(SavedPlugins))
|
||||||
|
|
||||||
currentTemp = self.extraArgs['tempStatusPath']
|
currentTemp = self.extraArgs['tempStatusPath']
|
||||||
self.extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
self.extraArgs['tempStatusPath'] = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
|
self.extraArgs['SavedPlugins'] = SavedPlugins
|
||||||
|
self.extraArgs['AllPluginsList'] = AllPluginsList
|
||||||
self.installWordPress()
|
self.installWordPress()
|
||||||
|
|
||||||
while (1):
|
while (1):
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $
|
|||||||
var adminEmail = $scope.adminEmail;
|
var adminEmail = $scope.adminEmail;
|
||||||
var WPPassword = $scope.WPPassword;
|
var WPPassword = $scope.WPPassword;
|
||||||
var WPVersions = $scope.WPVersions;
|
var WPVersions = $scope.WPVersions;
|
||||||
var pluginbucket = $scope.pluginbucket;
|
var pluginbucket = $('#pliginbucket').val();
|
||||||
var autoupdates = $scope.autoupdates;
|
var autoupdates = $scope.autoupdates;
|
||||||
var pluginupdates = $scope.pluginupdates;
|
var pluginupdates = $scope.pluginupdates;
|
||||||
var themeupdates = $scope.themeupdates;
|
var themeupdates = $scope.themeupdates;
|
||||||
@@ -284,7 +284,7 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $
|
|||||||
title: WPtitle,
|
title: WPtitle,
|
||||||
domain: domainNameCreate,
|
domain: domainNameCreate,
|
||||||
WPVersion: WPVersions,
|
WPVersion: WPVersions,
|
||||||
PluginsThemes: pluginbucket,
|
pluginbucket: pluginbucket,
|
||||||
adminUser: WPUsername,
|
adminUser: WPUsername,
|
||||||
Email: adminEmail,
|
Email: adminEmail,
|
||||||
PasswordByPass: WPPassword,
|
PasswordByPass: WPPassword,
|
||||||
@@ -423,6 +423,15 @@ app.controller('createWordpress', function ($scope, $http, $timeout, $compile, $
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//........... delete wp list
|
||||||
|
var FurlDeleteWP;
|
||||||
|
function DeleteWPNow(url) {
|
||||||
|
FurlDeleteWP = url;
|
||||||
|
}
|
||||||
|
function FinalDeleteWPNow() {
|
||||||
|
window.location.href = FurlDeleteWP;
|
||||||
|
}
|
||||||
app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $window) {
|
app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $window) {
|
||||||
$scope.wordpresshomeloading = true;
|
$scope.wordpresshomeloading = true;
|
||||||
$scope.stagingDetailsForm = false;
|
$scope.stagingDetailsForm = false;
|
||||||
@@ -482,7 +491,11 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
alert("Error:" + response.data.error_message)
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<div ng-hide="installationDetailsForm" class="form-group">
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
<label class="col-sm-3 control-label">{% trans "Plugin/Theme" %}</label>
|
<label class="col-sm-3 control-label">{% trans "Plugin/Theme" %}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<select ng-model="pluginbucket" class="form-control">
|
<select id="pliginbucket" ng-model="pluginbucket" class="form-control">
|
||||||
<option value="-1" selected>Select Plugin Bucket</option>
|
<option value="-1" selected>Select Plugin Bucket</option>
|
||||||
{% for wp in Plugins %}
|
{% for wp in Plugins %}
|
||||||
<option value="{{ wp.id }}">{{ wp.Name }}</option>
|
<option value="{{ wp.id }}">{{ wp.Name }}</option>
|
||||||
|
|||||||
@@ -17,11 +17,14 @@
|
|||||||
<div ng-controller="WPAddNewPlugin" class="panel">
|
<div ng-controller="WPAddNewPlugin" class="panel">
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="example-box-wrapper">
|
<div class="example-box-wrapper">
|
||||||
|
<h2>{{ BucketName }}</h2>
|
||||||
|
|
||||||
<form name="websiteCreationForm" action="/" id="createPackages"
|
<form name="websiteCreationForm" action="/" id="createPackages"
|
||||||
class="form-horizontal bordered-row panel-body">
|
class="form-horizontal bordered-row panel-body">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<label style="margin-bottom: 10px;">{% trans "Search Plugin Name" %}</label>
|
<label style="margin-bottom: 10px;">{% trans "Search Plugin Name" %}</label>
|
||||||
|
|
||||||
<input name="searchcontent" type="text" class="form-control" ng-model="searchcontent"
|
<input name="searchcontent" type="text" class="form-control" ng-model="searchcontent"
|
||||||
@@ -40,10 +43,12 @@
|
|||||||
<div id="selplug"
|
<div id="selplug"
|
||||||
style="background-color: #12207a; color: #FFFFFF; padding: 5px; border-radius: 30px">
|
style="background-color: #12207a; color: #FFFFFF; padding: 5px; border-radius: 30px">
|
||||||
{{ plugin }}
|
{{ plugin }}
|
||||||
<svg ng-click="deletesPlgin('{{plugin}}')" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"
|
<svg ng-click="deletesPlgin('{{ plugin }}')" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
aria-hidden="true"
|
||||||
role="img" width="1em" height="1em"
|
role="img" width="1em" height="1em"
|
||||||
preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16">
|
preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16">
|
||||||
<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
<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"/>
|
stroke-width="1.5" d="m11.25 4.75l-6.5 6.5m0-6.5l6.5 6.5"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
@@ -54,16 +59,6 @@
|
|||||||
|
|
||||||
</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="AddNewplugin()"
|
|
||||||
class="btn btn-primary btn-lg">{% trans "Add Plugin Bucket" %}</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -127,15 +127,43 @@
|
|||||||
|
|
||||||
<td style="padding: 13px;">
|
<td style="padding: 13px;">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|
||||||
data-toggle="modal"
|
data-toggle="modal"
|
||||||
data-target="#DeleteMember" aria-label=""
|
data-target="#DeleteMember" aria-label=""
|
||||||
|
onclick="DeleteWPNow('{% url 'ListWPSites' %}?DeleteID={{ sub.id }}')"
|
||||||
type="button" class="btn btn-border btn-alt border-red btn-link font-red">
|
type="button" class="btn btn-border btn-alt border-red btn-link font-red">
|
||||||
Delete
|
Delete
|
||||||
</button>
|
</button>
|
||||||
|
<div id="DeleteMember" 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">×
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title">Delete WordPress Site
|
||||||
|
<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">
|
||||||
|
|
||||||
|
<span>Do you want to delete the site??</span>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
onclick="FinalDeleteWPNow()">Yes
|
||||||
|
</button>
|
||||||
|
<button type="button" ng-disabled="savingSettings"
|
||||||
|
class="btn btn-default" data-dismiss="modal">
|
||||||
|
NOt
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -40,8 +40,9 @@ def WPCreate(request):
|
|||||||
def ListWPSites(request):
|
def ListWPSites(request):
|
||||||
try:
|
try:
|
||||||
userID = request.session['userID']
|
userID = request.session['userID']
|
||||||
|
DeleteID = request.GET.get('DeleteID')
|
||||||
wm = WebsiteManager()
|
wm = WebsiteManager()
|
||||||
return wm.ListWPSites(request, userID)
|
return wm.ListWPSites(request, userID, DeleteID)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class WebsiteManager:
|
|||||||
Data, 'createWebsite')
|
Data, 'createWebsite')
|
||||||
return proc.render()
|
return proc.render()
|
||||||
|
|
||||||
def ListWPSites(self, request=None, userID=None, data=None):
|
def ListWPSites(self, request=None, userID=None, DeleteID=None):
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
userobj = Administrator.objects.get(pk=userID)
|
userobj = Administrator.objects.get(pk=userID)
|
||||||
@@ -101,6 +101,14 @@ class WebsiteManager:
|
|||||||
tata['wpsites']=[]
|
tata['wpsites']=[]
|
||||||
tata['wp'] = WPSites.objects.all()
|
tata['wp'] = WPSites.objects.all()
|
||||||
|
|
||||||
|
try:
|
||||||
|
if DeleteID != None:
|
||||||
|
WPDelete = WPSites.objects.get(pk=DeleteID)
|
||||||
|
WPDelete.delete()
|
||||||
|
|
||||||
|
except BaseException as msg:
|
||||||
|
pass
|
||||||
|
|
||||||
for sub in tata['wp']:
|
for sub in tata['wp']:
|
||||||
tata['wpsites'].append({'id': sub.id,
|
tata['wpsites'].append({'id': sub.id,
|
||||||
'title': sub.title,
|
'title': sub.title,
|
||||||
@@ -248,6 +256,7 @@ class WebsiteManager:
|
|||||||
lmo = json.loads(pluginobj.config)
|
lmo = json.loads(pluginobj.config)
|
||||||
Data['Selectedplugins'] = lmo
|
Data['Selectedplugins'] = lmo
|
||||||
Data['pluginbID'] = pluginbID
|
Data['pluginbID'] = pluginbID
|
||||||
|
Data['BucketName'] = pluginobj.Name
|
||||||
|
|
||||||
|
|
||||||
proc = httpProc(request, 'websiteFunctions/WPEidtPlugin.html',
|
proc = httpProc(request, 'websiteFunctions/WPEidtPlugin.html',
|
||||||
@@ -418,6 +427,7 @@ class WebsiteManager:
|
|||||||
wpsite = WPSites.objects.get(pk=WPManagerID)
|
wpsite = WPSites.objects.get(pk=WPManagerID)
|
||||||
path = wpsite.path
|
path = wpsite.path
|
||||||
|
|
||||||
|
|
||||||
Webobj= Websites.objects.get(pk=wpsite.owner_id)
|
Webobj= Websites.objects.get(pk=wpsite.owner_id)
|
||||||
|
|
||||||
Vhuser = Webobj.externalApp
|
Vhuser = Webobj.externalApp
|
||||||
@@ -1036,7 +1046,7 @@ class WebsiteManager:
|
|||||||
extraArgs['domainName'] = data['domain']
|
extraArgs['domainName'] = data['domain']
|
||||||
extraArgs['WPVersion'] = data['WPVersion']
|
extraArgs['WPVersion'] = data['WPVersion']
|
||||||
extraArgs['blogTitle'] = data['title']
|
extraArgs['blogTitle'] = data['title']
|
||||||
extraArgs['PluginsThemes'] = data['PluginsThemes']
|
extraArgs['pluginbucket'] = data['pluginbucket']
|
||||||
extraArgs['adminUser'] = data['adminUser']
|
extraArgs['adminUser'] = data['adminUser']
|
||||||
extraArgs['PasswordByPass'] = data['PasswordByPass']
|
extraArgs['PasswordByPass'] = data['PasswordByPass']
|
||||||
extraArgs['adminPassword'] = data['PasswordByPass']
|
extraArgs['adminPassword'] = data['PasswordByPass']
|
||||||
|
|||||||
Reference in New Issue
Block a user