From 8f9131be1c245a9d4709ea332919e9f0663049d4 Mon Sep 17 00:00:00 2001 From: NaysKutzu Date: Sun, 14 Jan 2024 17:02:23 +0000 Subject: [PATCH] PUSH -> Fix bug that you can't delete servers in the waiting list -> Disable snow -> Added some developer options -> Bump some composer packages to the latest version! -> Now you can perform sql commands from the dashboard iself -> Now you can purge the caches from the ui and you don't need to use the cli anymore! --- composer.lock | 39 +++++++++--------- migrate/49.sql | 1 + migrate/50.sql | 1 + routes/admin/servers.php | 6 +++ routes/admin/settings.php | 10 +++++ view/admin/settings/cachepurge.php | 29 +++++++++++++ view/admin/settings/main.php | 66 +++++++++++++++++++++++++++++- view/admin/settings/sql.php | 32 +++++++++++++++ 8 files changed, 164 insertions(+), 20 deletions(-) create mode 100644 migrate/49.sql create mode 100644 migrate/50.sql create mode 100644 view/admin/settings/cachepurge.php create mode 100644 view/admin/settings/sql.php diff --git a/composer.lock b/composer.lock index 8894ab70..1fd8c9b9 100644 --- a/composer.lock +++ b/composer.lock @@ -114,16 +114,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.8.1", + "version": "v6.9.1", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "e88da8d679acc3824ff231fdc553565b802ac016" + "reference": "039de174cd9c17a8389754d3b877a2ed22743e18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/e88da8d679acc3824ff231fdc553565b802ac016", - "reference": "e88da8d679acc3824ff231fdc553565b802ac016", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/039de174cd9c17a8389754d3b877a2ed22743e18", + "reference": "039de174cd9c17a8389754d3b877a2ed22743e18", "shasum": "" }, "require": { @@ -143,6 +143,7 @@ "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { + "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", "ext-openssl": "Needed for secure SMTP sending and DKIM signing", "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", @@ -182,7 +183,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.9.1" }, "funding": [ { @@ -190,20 +191,20 @@ "type": "github" } ], - "time": "2023-08-29T08:26:30+00:00" + "time": "2023-11-25T22:23:28+00:00" }, { "name": "stripe/stripe-php", - "version": "v13.4.0", + "version": "v13.9.0", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "ff0a56c75ff50b50ed97c45c02dfaa2dd341c5b1" + "reference": "3d9250964c9d0bc9de8c706b16a90a82d9c8ed9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/ff0a56c75ff50b50ed97c45c02dfaa2dd341c5b1", - "reference": "ff0a56c75ff50b50ed97c45c02dfaa2dd341c5b1", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/3d9250964c9d0bc9de8c706b16a90a82d9c8ed9d", + "reference": "3d9250964c9d0bc9de8c706b16a90a82d9c8ed9d", "shasum": "" }, "require": { @@ -247,9 +248,9 @@ ], "support": { "issues": "https://github.com/stripe/stripe-php/issues", - "source": "https://github.com/stripe/stripe-php/tree/v13.4.0" + "source": "https://github.com/stripe/stripe-php/tree/v13.9.0" }, - "time": "2023-11-21T20:08:15+00:00" + "time": "2024-01-12T18:12:31+00:00" }, { "name": "symfony/deprecation-contracts", @@ -402,16 +403,16 @@ }, { "name": "symfony/yaml", - "version": "v6.3.8", + "version": "v6.4.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "3493af8a8dad7fa91c77fa473ba23ecd95334a92" + "reference": "4f9237a1bb42455d609e6687d2613dde5b41a587" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/3493af8a8dad7fa91c77fa473ba23ecd95334a92", - "reference": "3493af8a8dad7fa91c77fa473ba23ecd95334a92", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4f9237a1bb42455d609e6687d2613dde5b41a587", + "reference": "4f9237a1bb42455d609e6687d2613dde5b41a587", "shasum": "" }, "require": { @@ -423,7 +424,7 @@ "symfony/console": "<5.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0" + "symfony/console": "^5.4|^6.0|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -454,7 +455,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.3.8" + "source": "https://github.com/symfony/yaml/tree/v6.4.0" }, "funding": [ { @@ -470,7 +471,7 @@ "type": "tidelift" } ], - "time": "2023-11-06T10:58:05+00:00" + "time": "2023-11-06T11:00:25+00:00" } ], "packages-dev": [], diff --git a/migrate/49.sql b/migrate/49.sql new file mode 100644 index 00000000..5624386e --- /dev/null +++ b/migrate/49.sql @@ -0,0 +1 @@ +UPDATE `mythicaldash_settings` SET `version` = '3.1.2' WHERE `mythicaldash_settings`.`id` = 1; diff --git a/migrate/50.sql b/migrate/50.sql new file mode 100644 index 00000000..ef8fd7a6 --- /dev/null +++ b/migrate/50.sql @@ -0,0 +1 @@ +UPDATE `mythicaldash_settings` SET `show_snow` = 'false' WHERE `mythicaldash_settings`.`id` = 1; \ No newline at end of file diff --git a/routes/admin/servers.php b/routes/admin/servers.php index ccadb360..93c628e4 100644 --- a/routes/admin/servers.php +++ b/routes/admin/servers.php @@ -23,4 +23,10 @@ require("../include/main.php"); require("../view/admin/servers/logs.php"); }); + +$router->add("/admin/server/queue/delete", function () { + require("../include/main.php"); + require("../view/admin/servers/deleteq.php"); +}); + ?> diff --git a/routes/admin/settings.php b/routes/admin/settings.php index 29231ea3..5b54f24a 100644 --- a/routes/admin/settings.php +++ b/routes/admin/settings.php @@ -88,4 +88,14 @@ require("../include/main.php"); require("../view/admin/settings/tos.php"); }); + +$router->add("/admin/sql", function () { + require("../include/main.php"); + require("../view/admin/settings/sql.php"); +}); + +$router->add("/admin/purgecache", function () { + require("../include/main.php"); + require("../view/admin/settings/cachepurge.php"); +}); ?> \ No newline at end of file diff --git a/view/admin/settings/cachepurge.php b/view/admin/settings/cachepurge.php new file mode 100644 index 00000000..65f34787 --- /dev/null +++ b/view/admin/settings/cachepurge.php @@ -0,0 +1,29 @@ +query("TRUNCATE `mythicaldash_servers_logs`"); + $conn->query("TRUNCATE `mythicaldash_resetpasswords`"); + $conn->query("TRUNCATE `mythicaldash_login_logs`"); + $message = 'Query executed successfully'; + } catch (Exception $e) { + $message = $e->getMessage(); + } + header('location: /admin/settings?e=' . $message); + die(); + } catch (Exception $e) { + $message = 'Failed to run SQL script: ' . $e->getMessage(); + header('location: /admin/settings?e=' . $message); + die(); + } +} catch (Exception $e) { + ErrorHandler::Critical("MYSQL", "Failed to run SQL script: " . $e->getMessage()); + header('location: /admin/settings?e=Failed to run SQL script: ' . $e->getMessage()); + die(); +} +?> \ No newline at end of file diff --git a/view/admin/settings/main.php b/view/admin/settings/main.php index c2caa750..a727e6ff 100644 --- a/view/admin/settings/main.php +++ b/view/admin/settings/main.php @@ -33,6 +33,16 @@

Admin / Settings

+ + +
General
@@ -623,7 +633,8 @@ class="field-optional">
"> -

The email address where you send emails from.

+

The email address where you send emails + from.

@@ -1138,6 +1149,27 @@ class="btn btn-primary me-2 waves-effect waves-light" value="true">Save
+
+
Developer Options
+
+
+

+
+
+
+
+
+

  + Purge Internal Caches +
+
+
+
+
diff --git a/view/admin/settings/sql.php b/view/admin/settings/sql.php new file mode 100644 index 00000000..ea28d27c --- /dev/null +++ b/view/admin/settings/sql.php @@ -0,0 +1,32 @@ +query($_POST['cmd']); + + if ($result !== false) { + $message = 'Query executed successfully'; + } else { + $message = 'Query executed successfully, but no results returned.'; + } + header('location: /admin/settings?sqlr='.$message); + die(); + } catch (Exception $e) { + $message = 'Failed to run SQL script: ' . $e->getMessage(); + header('location: /admin/settings?sqlr='.$message); + die(); + } + } else { + $message = 'Failed to run SQL script: Null'; + header('location: /admin/settings?e=' . $message); + die(); + } +} catch (Exception $e) { + ErrorHandler::Critical("MYSQL","Failed to run SQL script: " . $e->getMessage()); + header('location: /admin/settings?e=Failed to run SQL script: ' . $e->getMessage()); + die(); +}