From 1b42d5cbb6915c0593262e81ab70f9407e7bd444 Mon Sep 17 00:00:00 2001 From: qtwrk Date: Sat, 9 Jul 2022 03:32:22 +0200 Subject: [PATCH 1/4] Update cyberpanel_utility.sh --- cyberpanel_utility.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cyberpanel_utility.sh b/cyberpanel_utility.sh index 48ecf995f..0e9398924 100644 --- a/cyberpanel_utility.sh +++ b/cyberpanel_utility.sh @@ -242,6 +242,7 @@ install_php_redis() { fi if [[ $SERVER_OS == "openEuler" ]] ; then #dnf install -y lsphp74-redis lsphp73-redis lsphp72-redis lsphp71-redis + echo " " fi echo -e "\nRedis extension for PHP has been installed..." exit From 4ce83cb4b0fe59a375f7ed13475c49e572dc457e Mon Sep 17 00:00:00 2001 From: qtwrk Date: Sat, 9 Jul 2022 03:33:06 +0200 Subject: [PATCH 2/4] Update cyberpanel_utility.sh --- cyberpanel_utility.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cyberpanel_utility.sh b/cyberpanel_utility.sh index 0e9398924..779d2b740 100644 --- a/cyberpanel_utility.sh +++ b/cyberpanel_utility.sh @@ -366,6 +366,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 + echo " " #yum install -y lsphp74-memcached lsphp73-memcached lsphp72-memcached lsphp71-memcached fi echo -e "\nMemcached extension for PHP has been installed..." From 66fb1dab5f9f7f00df82cbf259bd02e5dc188143 Mon Sep 17 00:00:00 2001 From: Aaron <18094530+aaronsmile@users.noreply.github.com> Date: Tue, 12 Jul 2022 13:57:18 +0800 Subject: [PATCH 3/4] fixed the install of redis&memcached on openEuler --- cyberpanel.sh | 6 ++---- cyberpanel_utility.sh | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cyberpanel.sh b/cyberpanel.sh index 0246e6915..769c9b643 100644 --- a/cyberpanel.sh +++ b/cyberpanel.sh @@ -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 diff --git a/cyberpanel_utility.sh b/cyberpanel_utility.sh index 779d2b740..c30de9fb1 100644 --- a/cyberpanel_utility.sh +++ b/cyberpanel_utility.sh @@ -241,8 +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 - echo " " + dnf install -y lsphp74-redis lsphp73-redis lsphp72-redis lsphp71-redis fi echo -e "\nRedis extension for PHP has been installed..." exit @@ -259,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..." @@ -366,8 +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 - echo " " - #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 From 471637f62ae96f30a8e669d0056843284e694b3f Mon Sep 17 00:00:00 2001 From: Hassan Hashmi <75794688+hassanhashmey@users.noreply.github.com> Date: Thu, 14 Jul 2022 10:18:49 -0700 Subject: [PATCH 4/4] scanwpsite --- .../websiteFunctions/websiteFunctions.js | 59 +++++++++++++++++++ .../websiteFunctions/WPsitesList.html | 38 +++++++++++- websiteFunctions/urls.py | 1 + websiteFunctions/views.py | 21 +++++++ websiteFunctions/website.py | 44 ++++++++++++++ 5 files changed, 162 insertions(+), 1 deletion(-) diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 7542b08a8..3fea84603 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -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' + }); + + + } + + + }; + }); diff --git a/websiteFunctions/templates/websiteFunctions/WPsitesList.html b/websiteFunctions/templates/websiteFunctions/WPsitesList.html index 47d60824b..5fd531d2e 100644 --- a/websiteFunctions/templates/websiteFunctions/WPsitesList.html +++ b/websiteFunctions/templates/websiteFunctions/WPsitesList.html @@ -90,8 +90,12 @@

{% trans "List WordPress Websites" %} {% trans "Create WordPress Website" %} + {% trans "Scan WordPress " %}

- +

{% trans "On this page you can launch, list, modify and delete Wordpress Sites from your server." %}

@@ -190,6 +194,38 @@ + + + + + {% endblock %} diff --git a/websiteFunctions/urls.py b/websiteFunctions/urls.py index 6a97fe0df..64ace1aa8 100755 --- a/websiteFunctions/urls.py +++ b/websiteFunctions/urls.py @@ -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'), diff --git a/websiteFunctions/views.py b/websiteFunctions/views.py index 7c93504c0..a9fec9bbf 100755 --- a/websiteFunctions/views.py +++ b/websiteFunctions/views.py @@ -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'] diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index ac3951d40..28f2ed8db 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -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: