mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-24 16:29:04 +01:00
Merge branch 'v2.3.3-dev' of github.com:usmannasir/cyberpanel into v2.3.3-dev
This commit is contained in:
@@ -1503,8 +1503,7 @@ if [[ $Server_OS = "Ubuntu" ]]; then
|
||||
fi
|
||||
fi
|
||||
if [[ $Server_OS = "openEuler" ]]; then
|
||||
#yum install -y lsphp??-memcached lsphp??-pecl-memcached
|
||||
echo -e "\nMemcached process and its PHP extensions for openEuler are in process of packaging...\n"
|
||||
yum install -y lsphp??-memcached lsphp??-pecl-memcached
|
||||
if [[ $Total_RAM -eq "2048" ]] || [[ $Total_RAM -gt "2048" ]]; then
|
||||
Post_Install_Addon_Mecached_LSMCD
|
||||
else
|
||||
@@ -1559,8 +1558,7 @@ else
|
||||
fi
|
||||
|
||||
if [[ "$Server_OS" = "openEuler" ]]; then
|
||||
#yum install -y lsphp??-redis redis
|
||||
echo -e "\nRedis process and its PHP extensions for openEuler are in process of packaging...\n"
|
||||
yum install -y lsphp??-redis redis6
|
||||
fi
|
||||
|
||||
if pgrep "redis" ; then
|
||||
|
||||
@@ -241,7 +241,7 @@ install_php_redis() {
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y lsphp74-redis lsphp73-redis lsphp72-redis lsphp71-redis lsphp70-redis
|
||||
fi
|
||||
if [[ $SERVER_OS == "openEuler" ]] ; then
|
||||
#dnf install -y lsphp74-redis lsphp73-redis lsphp72-redis lsphp71-redis
|
||||
dnf install -y lsphp74-redis lsphp73-redis lsphp72-redis lsphp71-redis
|
||||
fi
|
||||
echo -e "\nRedis extension for PHP has been installed..."
|
||||
exit
|
||||
@@ -258,7 +258,7 @@ install_redis() {
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y redis
|
||||
fi
|
||||
if [[ ! -f /usr/bin/redis-cli ]] && [[ $SERVER_OS == "openEuler" ]] ; then
|
||||
yum install -y redis
|
||||
yum install -y redis6
|
||||
fi
|
||||
if ifconfig -a | grep inet6 ; then
|
||||
echo -e "\n IPv6 detected..."
|
||||
@@ -365,7 +365,7 @@ install_php_memcached() {
|
||||
DEBIAN_FRONTEND=noninteractive apt install -y lsphp74-memcached lsphp73-memcached lsphp72-memcached lsphp71-memcached lsphp70-memcached
|
||||
fi
|
||||
if [[ $SERVER_OS == "openEuler" ]] ; then
|
||||
#yum install -y lsphp74-memcached lsphp73-memcached lsphp72-memcached lsphp71-memcached
|
||||
dnf install -y lsphp74-memcached lsphp73-memcached lsphp72-memcached lsphp71-memcached
|
||||
fi
|
||||
echo -e "\nMemcached extension for PHP has been installed..."
|
||||
exit
|
||||
|
||||
@@ -2640,6 +2640,65 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
|
||||
};
|
||||
|
||||
$scope.ScanWordpressSite = function () {
|
||||
|
||||
$('#cyberPanelLoading').show();
|
||||
|
||||
|
||||
var url = "/websites/ScanWordpressSite";
|
||||
|
||||
var data = {
|
||||
|
||||
}
|
||||
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
$('#cyberPanelLoading').hide();
|
||||
|
||||
if (response.data.status === 1) {
|
||||
new PNotify({
|
||||
title: 'Success!',
|
||||
text: 'Successfully Saved!.',
|
||||
type: 'success'
|
||||
});
|
||||
location.reload();
|
||||
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$('#cyberPanelLoading').hide();
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -90,8 +90,12 @@
|
||||
<h2 id="domainNamePage">{% trans "List WordPress Websites" %}
|
||||
<a class="pull-right btn btn-primary"
|
||||
href="{% url "createWordpress" %}">{% trans "Create WordPress Website" %}</a>
|
||||
<a style="margin-right: 1%" class="pull-right btn btn-primary"
|
||||
data-toggle="modal"
|
||||
data-target="#scaningmodal"
|
||||
href="#">{% trans "Scan WordPress " %}</a>
|
||||
</h2>
|
||||
<img ng-hide="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
|
||||
<img ng-hide="cyberPanelLoading" id="cyberPanelLoading" src="{% static 'images/loading.gif' %}">
|
||||
<p>{% trans "On this page you can launch, list, modify and delete Wordpress Sites from your server." %}</p>
|
||||
</div>
|
||||
|
||||
@@ -190,6 +194,38 @@
|
||||
</table>
|
||||
|
||||
|
||||
<!------------Start scaning wordpress Modal --->
|
||||
<div id="scaningmodal" 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">Scan WordPress Sites
|
||||
<img ng-hide="$parent.cyberPanelLoading"
|
||||
src="/static/images/loading.gif"
|
||||
style="display: none;">
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<span>Do you want to Scan Worpress site?</span>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary"
|
||||
ng-click="ScanWordpressSite()">Yes
|
||||
</button>
|
||||
<button type="button" ng-disabled="savingSettings"
|
||||
class="btn btn-default" data-dismiss="modal">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!------------End scaning wordpress Modal --->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -53,6 +53,7 @@ urlpatterns = [
|
||||
url(r'^SaveBackupSchedule', views.SaveBackupSchedule, name='SaveBackupSchedule'),
|
||||
url(r'^AddWPsiteforRemoteBackup', views.AddWPsiteforRemoteBackup, name='AddWPsiteforRemoteBackup'),
|
||||
url(r'^UpdateRemoteschedules', views.UpdateRemoteschedules, name='UpdateRemoteschedules'),
|
||||
url(r'^ScanWordpressSite', views.ScanWordpressSite, name='ScanWordpressSite'),
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -523,6 +523,27 @@ def UpdateRemoteschedules(request):
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def ScanWordpressSite(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
result = pluginManager.preWebsiteCreation(request)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
wm = WebsiteManager()
|
||||
coreResult = wm.ScanWordpressSite(userID, json.loads(request.body))
|
||||
|
||||
result = pluginManager.postWebsiteCreation(request, coreResult)
|
||||
if result != 200:
|
||||
return result
|
||||
|
||||
return coreResult
|
||||
|
||||
except KeyError:
|
||||
return redirect(loadLoginPage)
|
||||
|
||||
|
||||
def installwpcore(request):
|
||||
try:
|
||||
userID = request.session['userID']
|
||||
|
||||
@@ -1353,6 +1353,50 @@ class WebsiteManager:
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
def ScanWordpressSite(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
currentACL = ACLManager.loadedACL(userID)
|
||||
admin = Administrator.objects.get(pk=userID)
|
||||
|
||||
allweb = Websites.objects.all()
|
||||
|
||||
childdomain = ChildDomains.objects.all()
|
||||
|
||||
for web in allweb:
|
||||
webpath = "/home/%s/public_html" % web.domain
|
||||
command = "cat %s/wp-config.php" % webpath
|
||||
result, stdout = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
||||
|
||||
if result == 1:
|
||||
wpobj = WPSites(owner=web, title=web.domain, path=webpath, FinalURL=web.domain,
|
||||
AutoUpdates="Enabled", PluginUpdates="Enabled",
|
||||
ThemeUpdates="Enabled", )
|
||||
wpobj.save()
|
||||
|
||||
for chlid in childdomain:
|
||||
command = "cat %s/wp-config.php"%chlid.path
|
||||
result, stdout = ProcessUtilities.outputExecutioner(command, None, None, None, 1)
|
||||
|
||||
if result == 1:
|
||||
wpobj = WPSites(owner=chlid.master, title=chlid.domain, path=chlid.path, FinalURL=chlid.domain,
|
||||
AutoUpdates="Enabled", PluginUpdates="Enabled",
|
||||
ThemeUpdates="Enabled", )
|
||||
wpobj.save()
|
||||
|
||||
|
||||
|
||||
|
||||
data_ret = {'status': 1, 'error_message': 'None',}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
except BaseException as msg:
|
||||
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
|
||||
|
||||
def installwpcore(self, userID=None, data=None):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user