diff --git a/.gitignore b/.gitignore
index 98a8ecb3..6101a5ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,5 +17,6 @@ migrates.ini
/cli/logs
/public/pma.zip
/cli/*.yml
-/caches/github.json
-/MythicalDash
\ No newline at end of file
+/MythicalDash
+/MythicalDash.zip
+/mythicaldash_backup.sql
\ No newline at end of file
diff --git a/MythicalDash64 b/MythicalDash64
index f3a4c298..61409551 100755
Binary files a/MythicalDash64 and b/MythicalDash64 differ
diff --git a/MythicalDashARM32 b/MythicalDashARM32
index 5233adfa..86bcedec 100755
Binary files a/MythicalDashARM32 and b/MythicalDashARM32 differ
diff --git a/MythicalDashARM64 b/MythicalDashARM64
index 9adf3680..098dcf77 100755
Binary files a/MythicalDashARM64 and b/MythicalDashARM64 differ
diff --git a/app/Database/Connect.php b/app/Database/Connect.php
index ecc66b62..f13ac509 100644
--- a/app/Database/Connect.php
+++ b/app/Database/Connect.php
@@ -25,5 +25,22 @@ public function connectToDatabase() {
return $conn;
}
+
+ public static function getUserInfo(string $userToken, string $info) {
+ $connclass = new Connect();
+ $conn = $connclass->connectToDatabase();
+ $session_id = mysqli_real_escape_string($conn, $userToken);
+ $safeInfo = $conn->real_escape_string($info);
+ $query = "SELECT `$safeInfo` FROM mythicaldash_users WHERE api_key='$session_id' LIMIT 1";
+ $result = $conn->query($query);
+
+ if ($result && $result->num_rows > 0) {
+ $row = $result->fetch_assoc();
+ return $row[$info];
+ } else {
+ return null;
+ }
+
+ }
}
?>
\ No newline at end of file
diff --git a/app/Pterodactyl/Connection.php b/app/Pterodactyl/Connection.php
index cf84908e..283d6faa 100644
--- a/app/Pterodactyl/Connection.php
+++ b/app/Pterodactyl/Connection.php
@@ -20,6 +20,7 @@ public static function initializeSettings() {
*/
public static function checkConnection() : bool
{
+ self::initializeSettings();
$curl = curl_init();
curl_setopt_array($curl, array(
diff --git a/app/Pterodactyl/User.php b/app/Pterodactyl/User.php
new file mode 100644
index 00000000..f881b3fc
--- /dev/null
+++ b/app/Pterodactyl/User.php
@@ -0,0 +1,76 @@
+ $email,
+ 'username' => $username,
+ 'first_name' => $first_name,
+ 'last_name' => $last_name,
+ 'password' => $password
+ );
+
+ $ch = curl_init($url);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
+ curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
+
+ $response = curl_exec($ch);
+ $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+
+ curl_close($ch);
+
+ if ($statusCode == 201) {
+ $responseData = json_decode($response, true);
+ return $responseData['attributes']['id'];
+ } elseif ($statusCode == 422) {
+ $errorResponse = json_decode($response, true);
+ $errorMessages = array();
+
+ foreach ($errorResponse['errors'] as $error) {
+ $errorMessages[] = $error['detail'];
+ }
+
+ return implode("|", $errorMessages);
+ } else {
+ return "Unexpected error: " . $statusCode;
+ }
+ } else {
+ return false;
+ }
+ }
+
+
+ /**
+ * Delete a user from inside pterodactyl panel!
+ */
+ public static function Delete(string $id): bool
+ {
+ return false;
+ }
+}
+?>
\ No newline at end of file
diff --git a/caches/github.json b/caches/github.json
new file mode 100644
index 00000000..e10a1cc2
--- /dev/null
+++ b/caches/github.json
@@ -0,0 +1 @@
+{"url":"https://api.github.com/repos/MythicalLTD/MythicalDash/releases/137880538","assets_url":"https://api.github.com/repos/MythicalLTD/MythicalDash/releases/137880538/assets","upload_url":"https://uploads.github.com/repos/MythicalLTD/MythicalDash/releases/137880538/assets{?name,label}","html_url":"https://github.com/MythicalLTD/MythicalDash/releases/tag/3.1.3","id":137880538,"author":{"login":"NaysKutzu","id":87282334,"node_id":"MDQ6VXNlcjg3MjgyMzM0","avatar_url":"https://avatars.githubusercontent.com/u/87282334?v=4","gravatar_id":"","url":"https://api.github.com/users/NaysKutzu","html_url":"https://github.com/NaysKutzu","followers_url":"https://api.github.com/users/NaysKutzu/followers","following_url":"https://api.github.com/users/NaysKutzu/following{/other_user}","gists_url":"https://api.github.com/users/NaysKutzu/gists{/gist_id}","starred_url":"https://api.github.com/users/NaysKutzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaysKutzu/subscriptions","organizations_url":"https://api.github.com/users/NaysKutzu/orgs","repos_url":"https://api.github.com/users/NaysKutzu/repos","events_url":"https://api.github.com/users/NaysKutzu/events{/privacy}","received_events_url":"https://api.github.com/users/NaysKutzu/received_events","type":"User","site_admin":false},"node_id":"RE_kwDOJGZssM4IN-Pa","tag_name":"3.1.3","target_commitish":"develop","name":"3.1.3","draft":false,"prerelease":false,"created_at":"2024-01-20T21:34:54Z","published_at":"2024-01-21T11:13:12Z","assets":[{"url":"https://api.github.com/repos/MythicalLTD/MythicalDash/releases/assets/147116321","id":147116321,"node_id":"RA_kwDOJGZssM4IxNEh","name":"MythicalDash.zip","label":null,"uploader":{"login":"NaysKutzu","id":87282334,"node_id":"MDQ6VXNlcjg3MjgyMzM0","avatar_url":"https://avatars.githubusercontent.com/u/87282334?v=4","gravatar_id":"","url":"https://api.github.com/users/NaysKutzu","html_url":"https://github.com/NaysKutzu","followers_url":"https://api.github.com/users/NaysKutzu/followers","following_url":"https://api.github.com/users/NaysKutzu/following{/other_user}","gists_url":"https://api.github.com/users/NaysKutzu/gists{/gist_id}","starred_url":"https://api.github.com/users/NaysKutzu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NaysKutzu/subscriptions","organizations_url":"https://api.github.com/users/NaysKutzu/orgs","repos_url":"https://api.github.com/users/NaysKutzu/repos","events_url":"https://api.github.com/users/NaysKutzu/events{/privacy}","received_events_url":"https://api.github.com/users/NaysKutzu/received_events","type":"User","site_admin":false},"content_type":"application/x-zip-compressed","state":"uploaded","size":109762342,"download_count":8,"created_at":"2024-01-22T17:34:32Z","updated_at":"2024-01-22T17:36:37Z","browser_download_url":"https://github.com/MythicalLTD/MythicalDash/releases/download/3.1.3/MythicalDash.zip"}],"tarball_url":"https://api.github.com/repos/MythicalLTD/MythicalDash/tarball/3.1.3","zipball_url":"https://api.github.com/repos/MythicalLTD/MythicalDash/zipball/3.1.3","body":"-> Added a landing page\r\n-> Fresh theme for 2024\r\n-> Fixed update checker\r\n-> Bump CLI to net8.0\r\n-> Added a method to delete servers in database if they don't exist anymore in panel\r\n-> Added a translation system\r\n-> Added a confirmation for delete server\r\n-> Optimized some code\r\n-> Rewrote how the dash connects to the panel\r\n-> Fixed some minor bugs\r\n-> Added more things into README\r\n-> Now the dash has a default landing page theme\r\n-> Bump the build script to 8.0\r\n-> Bump composer packages to the latest version\r\n-> Added an option to change the background picture in dash!"}
\ No newline at end of file
diff --git a/cli/Program.cs b/cli/Program.cs
index 7217b073..8406895a 100644
--- a/cli/Program.cs
+++ b/cli/Program.cs
@@ -254,6 +254,11 @@ public static void Main(string[] args)
sh.DisableTurnstile();
Environment.Exit(0x0);
}
+ else if (args.Contains("-environment:lang"))
+ {
+ sh.SetEnglish();
+ Environment.Exit(0x0);
+ }
else if (args.Contains("-help"))
{
Console.Clear();
@@ -266,6 +271,7 @@ public static void Main(string[] args)
Console.WriteLine("‖ -environment:down ‖ Enter maintenance mode. ‖");
Console.WriteLine("‖ -environment:up ‖ Exit maintenance mode. ‖");
Console.WriteLine("‖ -environment:setup ‖ This is a command to help you setup your dashboard! ‖");
+ Console.WriteLine("‖ -environment:lang ‖ Resets the dashboard language to en_US ‖");
Console.WriteLine("‖ -turnstile:disable ‖ Stops turnstile from running! ‖");
Console.WriteLine("‖ -vpn:disable ‖ Stops anti vpn from running! ‖");
Console.WriteLine("‖ -key:generate ‖ Generate a new encryption key for MythicalDash. ‖");
diff --git a/cli/scripts/SettingsHandler.cs b/cli/scripts/SettingsHandler.cs
index 0b9dea95..6d2cf35b 100644
--- a/cli/scripts/SettingsHandler.cs
+++ b/cli/scripts/SettingsHandler.cs
@@ -85,10 +85,30 @@ public void Setup()
Program.logger.Log(LogType.Error, "It looks like the config file does not exist!");
}
}
- public void setLang(string lang) {
+ public void SetEnglish() {
if (fm.ConfigExists() == true)
{
-
+ try
+ {
+ getConnection();
+ using (var connection = new MySqlConnection(connectionString))
+ {
+ connection.Open();
+ ExecuteSQLScript(connection, "UPDATE `mythicaldash_settings` SET `lang` = 'en_US' WHERE `mythicaldash_settings`.`id` = 1;");
+ connection.Close();
+ }
+ string logDirectory = "logs";
+ string[] logFiles = Directory.GetFiles(logDirectory);
+ foreach (string logFile in logFiles)
+ {
+ File.Delete(logFile);
+ }
+ Program.logger.Log(LogType.Info, "Done");
+ }
+ catch (Exception ex)
+ {
+ Program.logger.Log(LogType.Error, "Sorry but the auto settings throws this error: " + ex.Message);
+ }
}
else
{
diff --git a/lang/en_US.php b/lang/en_US.php
index e386c7d9..ed2105bb 100644
--- a/lang/en_US.php
+++ b/lang/en_US.php
@@ -1,26 +1,51 @@
"Home",
"dashboard" => "Dashboard",
"store" => "Shop",
"help_center" => "Help-Center",
"login" => "Login",
"register" => "Register",
+ "create_server" => "Create server",
+ "buy_coins" => "Buy coins",
"or" => "or",
+ "earn" => "Earn",
+ "afk" => "AFK",
+ "profile" => "Profile",
+ "users" => "Users",
+ "back" => "Back",
+ "search" => "Search",
+ "payments" => "Payments",
"leaderboard" => "Leaderboard",
- "forgot_passowrd" => "Forgot passowrd",
+ "account" => "Account",
+ "connections" => "Connections",
+ "forgot_password" => "Forgot password",
+ "danger_zone" => "Danger Zone",
+ "danger_zone_read" => "Make sure you read what the button does!",
+ "danger_zone_warn" => "Once you press a button, there is no going back. Please be certain.",
"terms_of_service" => "Terms of service",
+ "reset_password" => "Reset your password",
+ "reset_key" => "Reset your secret key",
+ "reset_pwd_desc" => "After updating the key, the user will stay logged in!!",
+ "reset_key_desc" => "After updating the key, the user will have to login again.",
+ "delete_account" => "Delete your account",
+ "delete_account_danger" => "When you choose to delete this user, please be aware that all associated user data will be permanently wiped. This action is irreversible, so proceed with caution!",
"privacy_policy" => "Privacy policy",
+ "show_key_description" => "Here is your secret key that can be used to access our client API and this is your login security token, so make sure not to share it!",
"email" => "Email",
+ "save" => "Save",
+ "secret_key" => "Secret key",
"password" => "Password",
+ "show" => "Show",
"username" => "Username",
+ "new_password" => "New password",
"first_name" => "First name",
"last_name" => "Last name",
"send" => "Send",
"back_to_login" => "Back to login",
"store_need_more_coins" => "You need more coins to buy this!",
- "store_thanks_for_buying" => "Thank you for your purchase. We updated your resources!",
+ "store_thanks_for_buying" => "We updated your resources!",
"store_wana_buy_coins" => "Would you like to buy more coins?",
"store_not_have_enough_coins" => "You don't have enough coins.",
"store_buy" => "Purchase",
@@ -38,7 +63,7 @@
"disk" => "Disk",
"server_slot" => "Server Slot(s)",
"backup_slot" => "Server Backup(s)",
- "server_allocation" => "Server Allocation(Server Allocation)",
+ "server_allocation" => "Server Allocation(s)",
"mysql" => "Server Database(s)",
"coins" => "Coin(s)",
"statistics" => "Statistics",
@@ -52,12 +77,12 @@
"server_type" => "Server type",
"actions" => "Actions",
"help_center_help" => "Hello, how can we help?",
- "help_center_subhelp"=> "Common topics:",
+ "help_center_subhelp" => "Common topics:",
"help_center_popular_articles" => "Popular Articles",
"help_center_tos_desc" => "Read and agree to our Terms of Service before using our platforms.",
"help_center_pp_desc" => "Discover how we safeguard your personal information through our Privacy Policy.",
"help_center_read_more" => "Read more",
- "help_center_support" => "Support",
+ "help_center_support" => "Support",
"help_center_feel_help" => "You feel like you need more help?",
"help_center_open_ticket" => "Open a ticket",
"help_center_still_need_help" => "Still need help?",
@@ -66,15 +91,19 @@
"leaderboard_place" => "Place",
"leaderboard_username" => "Username",
"leaderboard_role" => "Role",
- "leaderboard_minutes" => "Minutes",
- //Auth related things
+ "leaderboard_minutes" => "Minute(s)",
+ // Auth related things
+ "joined_at" => "Joined",
+ "gift_coins" => "Gift coins",
+ "gift_coins_2" => "Gift user coins!",
+ "gift_coins_3" => "Remember, once you send a user coins, you cannot take this action back! Please do not open a ticket to get your coins back! We won't help you!!!",
"discord_oath2_link_failed" => "We are sorry but we don't provide support for discord link right now",
"discord_oath2_no_acc_found" => "No accounts were found under this discord account.",
"login_please_no_alts" => "Using multiple accounts is really sad when using free services!",
"login_please_no_vpn" => "Hmmm it looks like you are trying to abuse. You are trying to use a VPN, which is not allowed.",
"login_banned" => "We are sorry but you are banned from using our system!",
"login_mail_server_not_setup" => "We are sorry but we have no mail server by default",
- "login_erorr_unknown" => "We are sorry but we do not know what happened there was an internal system error!.",
+ "login_error_unknown" => "We are sorry but we do not know what happened there was an internal system error!",
"csrf_failed" => "CSRF Verification Failed",
"forgot_password_info" => "Enter your email and we'll send you instructions to reset your password",
"welcome_to" => "Welcome to",
@@ -86,10 +115,111 @@
"login_invalid_password" => "Invalid password",
"login_please_use" => "Please only use characters from A-Z in your",
"username_or_email_exists" => "Username or email already exists. Please choose a different one",
- "please_fill_in_all_required_info" => "please fill in all the required info",
+ "please_fill_in_all_required_info" => "Please fill in all the required info",
"register_subtitle" => "Please create an account and embark on your adventure!",
"terms_agree" => "I agree to the",
"register_have_an_account" => "Already have an account?",
"close" => "Close",
+ "updated_user_info_in_db" => "We updated the user settings in the database",
+ "pterodactyl_failed_to_update_info" => "Failed to update the user settings inside the panel",
+ "error_not_found_in_database" => "Sorry but I cant find this inside the database",
+ "error_while_drop_database" => "Failed to delete this from the database please logout!",
+ "linked_accounts" => "Linked accounts",
+ "linked_accounts_2" => "Here you can link your accounts so you won't have to worry about using a password or a email to login!",
+ "linked_accounts_not_connected" => "Not connected!",
+ "linked_accounts_disabled" => "Disabled by the host",
+ "avatar" => "Avatar",
+ "list" => "List",
+ "table_id" => "ID",
+ "ticket" => "Ticket",
+ "code" => "Code",
+ "getaway" => "Getaway",
+ "status" => "Status",
+ "ticket_deleted" => "We are sorry, but this ticket is archived. You can't access it anymore!",
+ "no_data_found_in_this_table" => "We are sorry but we did not find any data in this table!",
+ "buy_again" => "Buy again",
+ "input_not_valid" => "Please enter an valid value",
+ "you_cant_send_coins_to_yourself" => "Hey??? You cannot send coins to yourself!",
+ // Ticket related stuff
+ "reopen_ticket" => "Reopen ticket",
+ "delete_ticket" => "Delete ticket",
+ "export_ticket" => "Export ticket",
+ "reply_ticket" => "Reply",
+ "reply_ticket_2" => "Reply to the user inside the ticket!",
+ "close_ticket" => "Close Ticket",
+ "ticket_open_msg_1" => "Hi, and welcome to",
+ "ticket_open_msg_2" => "This is an automated message
+ from the
+ system to inform you that your ticket is now open.
Please do not spam any
+ staff member by any chance; this will not help you get support, and please
+ be respectful and make sure you read our terms of service and our rules.
+
If you feel like you need help quickly, make sure to join our community",
+ "ticket_subject" => "Ticket Subject:",
+ "ticket_status" => "Ticket Status: ",
+ "ticket_priority" => "Ticket Priority:",
+ "ticket_message" => "Message",
+ "ticket_attachment" => "Attachment",
+ "ticket_new" => "Create a new ticket",
+ "you_not_paid_for_this" => "Sorry but you did not pay for this!",
+ "already_claimed" => "The user already got his coins!",
+ "payment_request_cancel" => "We canceled the payment code",
+ "code_not_valid" => "This code is not valid",
+ "stripe_title" => "Buy Coins Using Stripe",
+ "stripe_subtitle" => "
Welcome to our billing system. Here you can buy coins, so you can use them inside our dashboard
The prices are '%PLACEHOLDER_1%' in %PLACEHOLDER_2% for 1 coin
", + "server_active" => "We've updated your server settings. Your server will now skip the next purge.", + "server_not_own" => "Sorry but you don't own this server!", + "server_deleted" => "Done, we deleted your server!", + "server_no_longer_in_wait_list" => "Your server is no longer in queue!", + "server_no_changes_made" => "No changes made.", + "server_minimum_is" => "Minimum %PLACEHOLDER_1% is %PLACEHOLDER_2%", + "server_you_not_have" => "You don't have enough %PLACEHOLDER_1%", + "server_updated" => "Done we updated your server settings!", + "server" => "Server", + "invalid_field" => "Some fields are empty or invalid.", + "server_location_does_not_exist" => "That location does not exist in our database!", + "server_egg_does_not_exist" => "That egg does not exist in our database!", + "server_created" => "Done, thanks for using %PLACEHOLDER_1%", + "name" => "Name", + "location" => "Location", + "slots" => "slots", + "egg" => "Egg", + "server_no_nodes" => "No nodes are available at the moment; Server creation might currently be disabled.", + "401_title" => "Not Authorized", + "401_subtitle" => "You are not authorized!", + "401_description" => "You do not have permission to view this page using the credentials that you have provided while login.%FEEDBACK_1_DESCRIPTION%
Change this into /templates/landing/index.html!!!
%FEEDBACK_2_DESCRIPTION%
Change this into /templates/landing/index.html!!!
%FEEDBACK_3_DESCRIPTION%
Change this into /templates/landing/index.html!!!