From eb51d00664ee3d08539e5e7f5a55b35d858266bc Mon Sep 17 00:00:00 2001 From: NaysKutzu Date: Tue, 17 Oct 2023 19:21:14 +0000 Subject: [PATCH] PUSH -> Added telemetry -> Added error report sending --- functions/report.php | 66 +++ functions/telemetry.php | 87 ++++ install/servercheck.php | 2 + public/index.php | 766 ++++++++++++++++---------------- view/admin/locations/create.php | 1 + view/admin/users/new_user.php | 1 + view/auth/login.php | 4 +- view/auth/register.php | 3 + view/requirements/page.php | 1 + view/server/create.php | 1 + view/tickets/new.php | 1 + 11 files changed, 551 insertions(+), 382 deletions(-) create mode 100644 functions/report.php create mode 100644 functions/telemetry.php diff --git a/functions/report.php b/functions/report.php new file mode 100644 index 00000000..b90fab64 --- /dev/null +++ b/functions/report.php @@ -0,0 +1,66 @@ + "https://api.mythicalsystems.me/problem?authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F&project=mythicaldash&type=error&title=".$title."&message=".$text, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_POSTFIELDS => "", + CURLOPT_HTTPHEADER => [ + "Content-Type: application/json", + "User-Agent: insomnia/8.2.0" + ], + ]); + + curl_exec($curl); +} + +function Warning($title, $text) +{ + $curl = curl_init(); + + curl_setopt_array($curl, [ + CURLOPT_URL => "https://api.mythicalsystems.me/problem?authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F&project=mythicaldash&type=warning&title=".$title."&message=".$text, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_POSTFIELDS => "", + CURLOPT_HTTPHEADER => [ + "Content-Type: application/json", + "User-Agent: insomnia/8.2.0" + ], + ]); + + curl_exec($curl); +} +function Critical($title, $text) +{ + $curl = curl_init(); + + curl_setopt_array($curl, [ + CURLOPT_URL => "https://api.mythicalsystems.me/problem?authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F&project=mythicaldash&type=critical&title=".$title."&message=".$text, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_POSTFIELDS => "", + CURLOPT_HTTPHEADER => [ + "Content-Type: application/json", + "User-Agent: insomnia/8.2.0" + ], + ]); + + curl_exec($curl); +} +?> \ No newline at end of file diff --git a/functions/telemetry.php b/functions/telemetry.php new file mode 100644 index 00000000..da9809ce --- /dev/null +++ b/functions/telemetry.php @@ -0,0 +1,87 @@ + "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewUser&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_POSTFIELDS => "", + ]); + + curl_exec($curl); +} +function NewServer() +{ + $curl = curl_init(); + + curl_setopt_array($curl, [ + CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewWebsite&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_POSTFIELDS => "", + ]); + + curl_exec($curl); +} +function NewInstall() +{ + $curl = curl_init(); + + curl_setopt_array($curl, [ + CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewInstall&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_POSTFIELDS => "", + ]); + + curl_exec($curl); +} +function NewNode() +{ + $curl = curl_init(); + + curl_setopt_array($curl, [ + CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewNode&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_POSTFIELDS => "", + ]); + + curl_exec($curl); +} +function NewTicket() +{ + $curl = curl_init(); + + curl_setopt_array($curl, [ + CURLOPT_URL => "https://api.mythicalsystems.me/telemetry?project=mythicaldash&action=NewTicket&authKey=AxWTnecj85SI4bG6rIP8bvw2uCF7W5MmkJcQIkrYS80MzeTraQWyICL690XOio8F", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => "", + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 30, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => "GET", + CURLOPT_POSTFIELDS => "", + ]); + + curl_exec($curl); +} +?> \ No newline at end of file diff --git a/install/servercheck.php b/install/servercheck.php index 56e60027..793693e6 100644 --- a/install/servercheck.php +++ b/install/servercheck.php @@ -2,7 +2,9 @@ ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); +include(__DIR__.'/../functions/telemetry.php'); if (isset($_GET['rr'])) { + NewInstall(); unlink("FIRST_INSTALL"); header('location: /'); } diff --git a/public/index.php b/public/index.php index e746d642..e2905a14 100644 --- a/public/index.php +++ b/public/index.php @@ -1,6 +1,6 @@ composer install --no-dev --optimize-autoloader". Please run that and refresh the page'); @@ -9,6 +9,8 @@ die('Hello, it looks like you did not run: composer install --no-dev --optimize-autoloader Please run that and refresh'); } require("../functions/https.php"); +require("../functions/report.php"); + if (!isHTTPS()) { header('HTTP/1.1 403 Forbidden'); http_response_code(403); @@ -19,385 +21,387 @@ die(json_encode($rsp, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); } -$router = new \Router\Router(); -if (file_exists('FIRST_INSTALL')) { - $router->add("/", function() { - require("../install/welcome.php"); - }); - $router->add("/server/check", function() { - require("../install/servercheck.php"); - }); - - $router->add("/(.*)", function() { - header('location: /'); - }); - - $router->route(); -} -else -{ - $router->add('/', function () { - require("../include/main.php"); - require("../view/index.php"); - }); - - $router->add("/api/mysql", function() { - require("../api/mysql.php"); - }); - - $router->add("/api/client/user/info", function() { - require("../include/main.php"); - require("../api/client/user/info.php"); - }); - - $router->add("/api/admin/user/info", function() { - require("../include/main.php"); - require("../api/admin/user/info.php"); - }); - - $router->add("/api/admin/showusers", function() { - require("../include/main.php"); - require("../api/admin/users.php"); - }); - - $router->add("/api/admin/statistics", function() { - require("../include/main.php"); - require("../api/admin/statistics.php"); - }); - - $router->add("/api/ticket", function() { - require("../include/main.php"); - require("../api/ticket.php"); - }); - - $router->add('/auth/login', function () { - require("../include/main.php"); - require("../view/auth/login.php"); - }); - - $router->add('/auth/link/discord', function () { - require("../include/main.php"); - require("../view/auth/discord.php"); - }); - - $router->add('/auth/register', function () { - require("../include/main.php"); - require("../view/auth/register.php"); - }); - - $router->add('/auth/logout', function () { - require("../include/main.php"); - require("../functions/logout.php"); - }); - - $router->add('/auth/forgot-password', function () { - require("../include/main.php"); - require("../view/auth/forgot-password.php"); - }); - - $router->add('/auth/reset-password', function () { - require("../include/main.php"); - require("../view/auth/reset-password.php"); - }); - - $router->add('/dashboard', function () { - require("../include/main.php"); - require("../view/dashboard.php"); - }); - - $router->add('/server/create', function () { - require("../include/main.php"); - require("../view/server/create.php"); - }); - - $router->add('/server/delete', function () { - require("../include/main.php"); - require("../view/server/delete.php"); - }); - - $router->add('/server/edit', function () { - require("../include/main.php"); - require("../view/server/edit.php"); - }); - - $router->add('/server/queue/delete', function () { - require("../include/main.php"); - require("../view/server/queueDelete.php"); - }); - - $router->add('/help-center/tos', function () { - require("../include/main.php"); - require("../view/legal/termsofservice.php"); - }); - - $router->add('/help-center/pp', function () { - require("../include/main.php"); - require("../view/legal/privacypolicy.php"); - }); - - $router->add('/help-center', function () { - require("../include/main.php"); - require("../view/help-center.php"); - }); - - $router->add('/help-center/tickets/new', function () { - require("../include/main.php"); - require("../view/tickets/new.php"); - }); - - $router->add('/help-center/tickets', function () { - require("../include/main.php"); - require("../view/tickets/list.php"); - }); - - $router->add('/help-center/tickets/view', function () { - require("../include/main.php"); - require("../view/tickets/chat.php"); - }); - - $router->add('/help-center/tickets/reply', function () { - require("../include/main.php"); - require("../view/tickets/reply.php"); - }); - - $router->add('/help-center/tickets/close', function () { - require("../include/main.php"); - require("../view/tickets/close.php"); - }); - - $router->add('/help-center/tickets/reopen', function () { - require("../include/main.php"); - require("../view/tickets/reopen.php"); - }); - - $router->add('/help-center/tickets/delete', function () { - require("../include/main.php"); - require("../view/tickets/delete.php"); - }); - - $router->add("/e/critical", function () { - require("../view/errors/critical.php"); - }); - - $router->add("/e/404", function () { - require("../include/main.php"); - require("../view/errors/404.php"); - }); - - $router->add("/user/edit",function () { - require("../include/main.php"); - require("../view/user/edit.php"); - }); - - $router->add("/user/profile",function () { - require("../include/main.php"); - require("../view/user/profile.php"); - }); - - $router->add("/user/gift",function () { - require("../include/main.php"); - require("../view/user/gift.php"); - }); - - $router->add("/user/connections",function () { - require("../include/main.php"); - require("../view/user/connections.php"); - }); - - $router->add("/users/list",function () { - require("../include/main.php"); - require("../view/user/list.php"); - }); - - $router->add("/user/security/delete_account",function () { - require("../include/main.php"); - require("../view/user/deleteacc.php"); - }); - - $router->add("/user/security/resetkey",function () { - require("../include/main.php"); - require("../view/user/resetkey.php"); - }); - - $router->add("/user/security/resetpwd",function () { - require("../include/main.php"); - require("../view/user/resetpwd.php"); - }); - - $router->add("/blank",function () { - require("../include/main.php"); - require("../view/blank.php"); - }); - - $router->add("/store",function () { - require("../include/main.php"); - require("../view/store.php"); - }); - - $router->add("/earn/afk",function () { - require("../include/main.php"); - require("../view/earn/afk.php"); - }); - - $router->add("/earn/redeem",function () { - require("../include/main.php"); - require("../view/earn/redeem.php"); - }); - - $router->add("/admin/settings",function () { - require("../include/main.php"); - require("../view/admin/settings/main.php"); - }); - - $router->add("/admin/redeem",function () { - require("../include/main.php"); - require("../view/admin/redeem/main.php"); - }); - - $router->add("/admin/redeem/create",function () { - require("../include/main.php"); - require("../view/admin/redeem/create.php"); - }); - - $router->add("/admin/redeem/delete",function () { - require("../include/main.php"); - require("../view/admin/redeem/delete.php"); - }); - - $router->add("/admin/settings/discord",function () { - require("../include/main.php"); - require("../view/admin/settings/discord.php"); - }); - - $router->add("/admin/settings/mail",function () { - require("../include/main.php"); - require("../view/admin/settings/mail.php"); - }); - - $router->add("/admin/settings/general",function () { - require("../include/main.php"); - require("../view/admin/settings/general.php"); - }); - - $router->add("/admin/settings/recaptcha",function () { - require("../include/main.php"); - require("../view/admin/settings/recaptcha.php"); - }); - - $router->add("/admin/settings/pterodactyl",function () { - require("../include/main.php"); - require("../view/admin/settings/pterodactyl.php"); - }); - - $router->add("/admin/locations",function () { - require("../include/main.php"); - require("../view/admin/locations/main.php"); - }); - - $router->add("/admin/locations/create",function () { - require("../include/main.php"); - require("../view/admin/locations/create.php"); - }); - - $router->add("/admin/locations/delete",function () { - require("../include/main.php"); - require("../view/admin/locations/delete.php"); - }); - - $router->add("/admin/eggs/delete",function () { - require("../include/main.php"); - require("../view/admin/eggs/delete.php"); - }); - - $router->add("/admin/eggs/create",function () { - require("../include/main.php"); - require("../view/admin/eggs/create.php"); - }); - - $router->add("/admin/eggs",function () { - require("../include/main.php"); - require("../view/admin/eggs/main.php"); - }); - - $router->add("/admin/settings/seo",function () { - require("../include/main.php"); - require("../view/admin/settings/seo.php"); - }); - - $router->add("/admin/settings/store",function () { - require("../include/main.php"); - require("../view/admin/settings/store.php"); - }); - - $router->add("/admin/users/view",function () { - require("../include/main.php"); - require("../view/admin/users/view_users.php"); - }); - - $router->add("/admin/users/edit",function () { - require("../include/main.php"); - require("../view/admin/users/edit_user.php"); - }); - - $router->add("/admin/users/new",function () { - require("../include/main.php"); - require("../view/admin/users/new_user.php"); - }); - - $router->add("/admin/users/delete",function () { - require("../include/main.php"); - require("../view/admin/users/delete_user.php"); - }); - - $router->add("/admin/users/security/resetkey",function() { - require("../include/main.php"); - require("../view/admin/users/user_reset_key.php"); - }); - - $router->add("/admin/users/security/resetpwd",function() { - require("../include/main.php"); - require("../view/admin/users/user_reset_password.php"); - }); - - $router->add("/admin/tickets",function() { - require("../include/main.php"); - require("../view/admin/tickets/list.php"); - }); - - $router->add("/admin/api/create",function () { - require("../include/main.php"); - require("../view/admin/api/create.php"); - }); - - $router->add("/admin/api/delete",function () { - require("../include/main.php"); - require("../view/admin/api/delete.php"); - }); - - $router->add("/admin/api",function () { - require("../include/main.php"); - require("../view/admin/api/main.php"); - }); - - $router->add("/email/reset-password",function() { - require("../include/main.php"); - require("../view/email/reset-password.php"); - }); - - $router->add("/e/401", function () { - require("../include/main.php"); - require("../view/errors/401.php"); - }); - - $router->add("/e/maintenance", function () { - require("../include/main.php"); - require("../view/errors/maintenance.php"); - }); - - $router->add("/(.*)", function () { - require("../include/main.php"); - require("../view/errors/404.php"); - }); - $router->route(); +try { + $router = new \Router\Router(); + if (file_exists('FIRST_INSTALL')) { + $router->add("/", function () { + require("../install/welcome.php"); + }); + $router->add("/server/check", function () { + require("../install/servercheck.php"); + }); + + $router->add("/(.*)", function () { + header('location: /'); + }); + + $router->route(); + } else { + $router->add('/', function () { + require("../include/main.php"); + require("../view/index.php"); + }); + + $router->add("/api/mysql", function () { + require("../api/mysql.php"); + }); + + $router->add("/api/client/user/info", function () { + require("../include/main.php"); + require("../api/client/user/info.php"); + }); + + $router->add("/api/admin/user/info", function () { + require("../include/main.php"); + require("../api/admin/user/info.php"); + }); + + $router->add("/api/admin/showusers", function () { + require("../include/main.php"); + require("../api/admin/users.php"); + }); + + $router->add("/api/admin/statistics", function () { + require("../include/main.php"); + require("../api/admin/statistics.php"); + }); + + $router->add("/api/ticket", function () { + require("../include/main.php"); + require("../api/ticket.php"); + }); + + $router->add('/auth/login', function () { + require("../include/main.php"); + require("../view/auth/login.php"); + }); + + $router->add('/auth/link/discord', function () { + require("../include/main.php"); + require("../view/auth/discord.php"); + }); + + $router->add('/auth/register', function () { + require("../include/main.php"); + require("../view/auth/register.php"); + }); + + $router->add('/auth/logout', function () { + require("../include/main.php"); + require("../functions/logout.php"); + }); + + $router->add('/auth/forgot-password', function () { + require("../include/main.php"); + require("../view/auth/forgot-password.php"); + }); + + $router->add('/auth/reset-password', function () { + require("../include/main.php"); + require("../view/auth/reset-password.php"); + }); + + $router->add('/dashboard', function () { + require("../include/main.php"); + require("../view/dashboard.php"); + }); + + $router->add('/server/create', function () { + require("../include/main.php"); + require("../view/server/create.php"); + }); + + $router->add('/server/delete', function () { + require("../include/main.php"); + require("../view/server/delete.php"); + }); + + $router->add('/server/edit', function () { + require("../include/main.php"); + require("../view/server/edit.php"); + }); + + $router->add('/server/queue/delete', function () { + require("../include/main.php"); + require("../view/server/queueDelete.php"); + }); + + $router->add('/help-center/tos', function () { + require("../include/main.php"); + require("../view/legal/termsofservice.php"); + }); + + $router->add('/help-center/pp', function () { + require("../include/main.php"); + require("../view/legal/privacypolicy.php"); + }); + + $router->add('/help-center', function () { + require("../include/main.php"); + require("../view/help-center.php"); + }); + + $router->add('/help-center/tickets/new', function () { + require("../include/main.php"); + require("../view/tickets/new.php"); + }); + + $router->add('/help-center/tickets', function () { + require("../include/main.php"); + require("../view/tickets/list.php"); + }); + + $router->add('/help-center/tickets/view', function () { + require("../include/main.php"); + require("../view/tickets/chat.php"); + }); + + $router->add('/help-center/tickets/reply', function () { + require("../include/main.php"); + require("../view/tickets/reply.php"); + }); + + $router->add('/help-center/tickets/close', function () { + require("../include/main.php"); + require("../view/tickets/close.php"); + }); + + $router->add('/help-center/tickets/reopen', function () { + require("../include/main.php"); + require("../view/tickets/reopen.php"); + }); + + $router->add('/help-center/tickets/delete', function () { + require("../include/main.php"); + require("../view/tickets/delete.php"); + }); + + $router->add("/e/critical", function () { + require("../view/errors/critical.php"); + }); + + $router->add("/e/404", function () { + require("../include/main.php"); + require("../view/errors/404.php"); + }); + + $router->add("/user/edit", function () { + require("../include/main.php"); + require("../view/user/edit.php"); + }); + + $router->add("/user/profile", function () { + require("../include/main.php"); + require("../view/user/profile.php"); + }); + + $router->add("/user/gift", function () { + require("../include/main.php"); + require("../view/user/gift.php"); + }); + + $router->add("/user/connections", function () { + require("../include/main.php"); + require("../view/user/connections.php"); + }); + + $router->add("/users/list", function () { + require("../include/main.php"); + require("../view/user/list.php"); + }); + + $router->add("/user/security/delete_account", function () { + require("../include/main.php"); + require("../view/user/deleteacc.php"); + }); + + $router->add("/user/security/resetkey", function () { + require("../include/main.php"); + require("../view/user/resetkey.php"); + }); + + $router->add("/user/security/resetpwd", function () { + require("../include/main.php"); + require("../view/user/resetpwd.php"); + }); + + $router->add("/blank", function () { + require("../include/main.php"); + require("../view/blank.php"); + }); + + $router->add("/store", function () { + require("../include/main.php"); + require("../view/store.php"); + }); + + $router->add("/earn/afk", function () { + require("../include/main.php"); + require("../view/earn/afk.php"); + }); + + $router->add("/earn/redeem", function () { + require("../include/main.php"); + require("../view/earn/redeem.php"); + }); + + $router->add("/admin/settings", function () { + require("../include/main.php"); + require("../view/admin/settings/main.php"); + }); + + $router->add("/admin/redeem", function () { + require("../include/main.php"); + require("../view/admin/redeem/main.php"); + }); + + $router->add("/admin/redeem/create", function () { + require("../include/main.php"); + require("../view/admin/redeem/create.php"); + }); + + $router->add("/admin/redeem/delete", function () { + require("../include/main.php"); + require("../view/admin/redeem/delete.php"); + }); + + $router->add("/admin/settings/discord", function () { + require("../include/main.php"); + require("../view/admin/settings/discord.php"); + }); + + $router->add("/admin/settings/mail", function () { + require("../include/main.php"); + require("../view/admin/settings/mail.php"); + }); + + $router->add("/admin/settings/general", function () { + require("../include/main.php"); + require("../view/admin/settings/general.php"); + }); + + $router->add("/admin/settings/recaptcha", function () { + require("../include/main.php"); + require("../view/admin/settings/recaptcha.php"); + }); + + $router->add("/admin/settings/pterodactyl", function () { + require("../include/main.php"); + require("../view/admin/settings/pterodactyl.php"); + }); + + $router->add("/admin/locations", function () { + require("../include/main.php"); + require("../view/admin/locations/main.php"); + }); + + $router->add("/admin/locations/create", function () { + require("../include/main.php"); + require("../view/admin/locations/create.php"); + }); + + $router->add("/admin/locations/delete", function () { + require("../include/main.php"); + require("../view/admin/locations/delete.php"); + }); + + $router->add("/admin/eggs/delete", function () { + require("../include/main.php"); + require("../view/admin/eggs/delete.php"); + }); + + $router->add("/admin/eggs/create", function () { + require("../include/main.php"); + require("../view/admin/eggs/create.php"); + }); + + $router->add("/admin/eggs", function () { + require("../include/main.php"); + require("../view/admin/eggs/main.php"); + }); + + $router->add("/admin/settings/seo", function () { + require("../include/main.php"); + require("../view/admin/settings/seo.php"); + }); + + $router->add("/admin/settings/store", function () { + require("../include/main.php"); + require("../view/admin/settings/store.php"); + }); + + $router->add("/admin/users/view", function () { + require("../include/main.php"); + require("../view/admin/users/view_users.php"); + }); + + $router->add("/admin/users/edit", function () { + require("../include/main.php"); + require("../view/admin/users/edit_user.php"); + }); + + $router->add("/admin/users/new", function () { + require("../include/main.php"); + require("../view/admin/users/new_user.php"); + }); + + $router->add("/admin/users/delete", function () { + require("../include/main.php"); + require("../view/admin/users/delete_user.php"); + }); + + $router->add("/admin/users/security/resetkey", function () { + require("../include/main.php"); + require("../view/admin/users/user_reset_key.php"); + }); + + $router->add("/admin/users/security/resetpwd", function () { + require("../include/main.php"); + require("../view/admin/users/user_reset_password.php"); + }); + + $router->add("/admin/tickets", function () { + require("../include/main.php"); + require("../view/admin/tickets/list.php"); + }); + + $router->add("/admin/api/create", function () { + require("../include/main.php"); + require("../view/admin/api/create.php"); + }); + + $router->add("/admin/api/delete", function () { + require("../include/main.php"); + require("../view/admin/api/delete.php"); + }); + + $router->add("/admin/api", function () { + require("../include/main.php"); + require("../view/admin/api/main.php"); + }); + + $router->add("/email/reset-password", function () { + require("../include/main.php"); + require("../view/email/reset-password.php"); + }); + + $router->add("/e/401", function () { + require("../include/main.php"); + require("../view/errors/401.php"); + }); + + $router->add("/e/maintenance", function () { + require("../include/main.php"); + require("../view/errors/maintenance.php"); + }); + + $router->add("/(.*)", function () { + require("../include/main.php"); + require("../view/errors/404.php"); + }); + $router->route(); + } +} catch (Exception $e) { + Warning("", $e->getMessage()); } ?> \ No newline at end of file diff --git a/view/admin/locations/create.php b/view/admin/locations/create.php index 7f330805..248719de 100644 --- a/view/admin/locations/create.php +++ b/view/admin/locations/create.php @@ -18,6 +18,7 @@ } else { $conn->query("INSERT INTO `mythicaldash_locations` (`name`, `locationid`, `slots`) VALUES ('" . $name . "', '" . $locationid . "', '" . $slots . "');"); + NewNode(); header('location: /admin/locations?s=Done we added a new location'); $conn->close(); die(); diff --git a/view/admin/users/new_user.php b/view/admin/users/new_user.php index 944ac621..a45b33e4 100644 --- a/view/admin/users/new_user.php +++ b/view/admin/users/new_user.php @@ -21,6 +21,7 @@ die(); } else { $conn->query("INSERT INTO `mythicaldash_users` (`email`, `username`, `first_name`, `last_name`, `password`, `api_key`) VALUES ('" . $email . "', '" . $username . "', '" . $firstName . "', '" . $lastName . "', '" . $password . "', '" . $skey . "');"); + NewUser(); header('location: /admin/users/view'); $conn->close(); die(); diff --git a/view/auth/login.php b/view/auth/login.php index e3d3a8fd..5ffa78d0 100644 --- a/view/auth/login.php +++ b/view/auth/login.php @@ -1,5 +1,7 @@ close(); + NewUser(); header('location: /auth/login'); die(); } diff --git a/view/requirements/page.php b/view/requirements/page.php index deb9f2bf..5f8409ca 100644 --- a/view/requirements/page.php +++ b/view/requirements/page.php @@ -1,4 +1,5 @@ query("SELECT * FROM mythicaldash_users WHERE api_key = '".$_COOKIE['token']. "'")->fetch_array(); ?> \ No newline at end of file diff --git a/view/server/create.php b/view/server/create.php index 2715fff4..b21418a6 100644 --- a/view/server/create.php +++ b/view/server/create.php @@ -188,6 +188,7 @@ '$queue', '" . $s_egg . "', '$userdb->panel_id')"); + NewServer(); header('location: /dashboard?s=Done thanks for using '.$settings['name']); die(); } else { diff --git a/view/tickets/new.php b/view/tickets/new.php index 2f850133..e4401ce0 100644 --- a/view/tickets/new.php +++ b/view/tickets/new.php @@ -28,6 +28,7 @@ ->setThumbnail($settings['logo']) ) ->execute(); + NewTicket(); header('location: /help-center/tickets'); $conn->close(); die();