From 101bfd0d308192d582f1dc810eec8805e2f82be2 Mon Sep 17 00:00:00 2001 From: Elizabeth Cray Date: Mon, 2 Oct 2023 00:23:59 -0400 Subject: [PATCH] Helper file and token prep --- auth/index.php | 15 ++++----------- index.js | 11 +++++++++-- index.php | 16 +++++++++++++++- secret/helpers.php | 22 ++++++++++++++++++++++ 4 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 secret/helpers.php diff --git a/auth/index.php b/auth/index.php index fe840eb..db7f212 100644 --- a/auth/index.php +++ b/auth/index.php @@ -1,20 +1,12 @@ = 3){ diff --git a/index.js b/index.js index 4f83c0f..47114ea 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,6 @@ var DEBUG = false; var isMobile = false; var USE_ORIGIN = ""; -// TODO: Add check for DOMAIN_OVERRIDE const dbp = (msg) => { if(DEBUG){ @@ -21,7 +20,12 @@ const SwalConfig = { buttonsStyling: false, } -const invalidChars = ['/', '\\', '>', '<', ':', '*', '|', '"', '\'', '?', '\0']; +const invalidChars = [ + '/', '\\', '>', + '<', ':', '*', + '|', '"', '\'', + '?', '\0' +]; const replaceInvalid = (str) => { var cache = str; @@ -278,7 +282,9 @@ $(() => { dbp("Is Mobile 👍🏻"); disableNonDesktopElements(); } + // Auto Retry + // TODO: Replace with redirect to home with logout set if error var isRetry = false; if(window.location.pathname.includes("auth")){ var ErrorMsg = document.getElementById("ErrorResult"); @@ -289,6 +295,7 @@ $(() => { beginOauth(); } } + // Console Welcome if(!isRetry){ console.log("%cWelcome Hacker!", "color: #ff0000; font-size: 7em; font-style: italic; font-family: 'Times New Roman', Times, serif;"); diff --git a/index.php b/index.php index 5d7145b..c8c713c 100755 --- a/index.php +++ b/index.php @@ -1,4 +1,18 @@ + + HackersTown Server Access @@ -35,7 +49,7 @@
- +
diff --git a/secret/helpers.php b/secret/helpers.php new file mode 100644 index 0000000..7511378 --- /dev/null +++ b/secret/helpers.php @@ -0,0 +1,22 @@ + 0) { + foreach ($_COOKIE as $key => $value) { + setcookie($key, "", time()-3600); + } + } +} + + +function flog($log_msg) { + $log_filename = "/var/www/html"; + $log_file_data = $log_filename.'/log_' . date('d-M-Y') . '.log'; + file_put_contents($log_file_data, $log_msg . "\n", FILE_APPEND); +} + +function enableDebug(){ + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + error_reporting(E_ALL); +} +?>