From 71c080298fd790661bc913d404a5674a0c5ce10a Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 12:08:04 +0100 Subject: [PATCH 01/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Brendan Price <56489848+brendanprice2003@users.noreply.github.com> --- .security-scan | 50 +++++++++++++------------- .version | 2 +- Modules/{Functions.php => modules.php} | 0 index.php | 16 ++++----- 4 files changed, 33 insertions(+), 35 deletions(-) rename Modules/{Functions.php => modules.php} (100%) diff --git a/.security-scan b/.security-scan index 9397bba..c466f69 100644 --- a/.security-scan +++ b/.security-scan @@ -614,7 +614,7 @@ { "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -640,7 +640,7 @@ "id": 0, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -657,7 +657,7 @@ "id": 1, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -674,7 +674,7 @@ "id": 2, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -691,7 +691,7 @@ "id": 3, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -708,7 +708,7 @@ "id": 4, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -725,7 +725,7 @@ "id": 5, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -742,7 +742,7 @@ "id": 6, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -759,7 +759,7 @@ "id": 7, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1154,7 +1154,7 @@ { "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1180,7 +1180,7 @@ "id": 0, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1197,7 +1197,7 @@ "id": 1, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1214,7 +1214,7 @@ "id": 2, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1231,7 +1231,7 @@ "id": 3, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1248,7 +1248,7 @@ "id": 4, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1265,7 +1265,7 @@ "id": 5, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1282,7 +1282,7 @@ "id": 6, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1299,7 +1299,7 @@ "id": 7, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1316,7 +1316,7 @@ "id": 8, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1363,7 +1363,7 @@ { "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1389,7 +1389,7 @@ "id": 0, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1406,7 +1406,7 @@ "id": 1, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1453,7 +1453,7 @@ { "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1479,7 +1479,7 @@ "id": 0, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1496,7 +1496,7 @@ "id": 1, "physicalLocation": { "artifactLocation": { - "uri": "Modules/functions.php", + "uri": "Modules/modules.php", "uriBaseId": "%SRCROOT%" }, "region": { diff --git a/.version b/.version index a6cbf52..b59fc6c 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -{ "BRANCH": "main", "VERSION":"1.2.0" } \ No newline at end of file +{ "BRANCH": "main", "VERSION":"1.1.10" } \ No newline at end of file diff --git a/Modules/Functions.php b/Modules/modules.php similarity index 100% rename from Modules/Functions.php rename to Modules/modules.php diff --git a/index.php b/index.php index a9ab71c..13db09f 100644 --- a/index.php +++ b/index.php @@ -7,39 +7,37 @@ /* Initialise Displays */ if ($url == "dataProcessing") { /* Form Submission Handler */ - require("./Modules/functions.php"); - //setupStorageMethod(); // Check database + require("./Modules/modules.php"); require("./Public/dataProcessing.php"); return; } if ($url == "view") { /* View Message Page */ - require("./Modules/functions.php"); - //setupStorageMethod(); // Check database + require("./Modules/modules.php"); require("./Public/view.php"); return; } if ($url == "") { /* Primary Display Page */ - require("./Modules/functions.php"); + require("./Modules/modules.php"); setupStorageMethod(); // Check database require("./Public/index.php"); } elseif ($url == "404") { /* Not Found Page */ - require("./Modules/functions.php"); + require("./Modules/modules.php"); return require("./Public/error/404.php"); } elseif ($url == "403") { /* Not Found Page */ - require("./Modules/functions.php"); + require("./Modules/modules.php"); return require("./Public/error/403.php"); } else { if ($url == "500") { /* Server Error Page */ - require("./Modules/functions.php"); + require("./Modules/modules.php"); return require("./Public/error/500.php"); } else { /* Not Found Page */ - require("./Modules/functions.php"); + require("./Modules/modules.php"); return require("./Public/error/404.php"); } } From 50fcb858b8ba68dbf6c8ad4885fda2ba6f118597 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 12:11:38 +0100 Subject: [PATCH 02/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10-dev=20Minor=20Comm?= =?UTF-8?q?it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Brendan Price <56489848+brendanprice2003@users.noreply.github.com> --- .htaccess | 2 +- .security-scan | 50 +++++++++++++------------- .version | 2 +- Modules/{modules.php => functions.php} | 0 index.php | 14 ++++---- 5 files changed, 34 insertions(+), 34 deletions(-) rename Modules/{modules.php => functions.php} (100%) diff --git a/.htaccess b/.htaccess index f47fe51..b557439 100644 --- a/.htaccess +++ b/.htaccess @@ -10,7 +10,7 @@ ErrorDocument 403 /403 ErrorDocument 500 /500 # File security - + Order allow,deny Deny from all \ No newline at end of file diff --git a/.security-scan b/.security-scan index c466f69..9397bba 100644 --- a/.security-scan +++ b/.security-scan @@ -614,7 +614,7 @@ { "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -640,7 +640,7 @@ "id": 0, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -657,7 +657,7 @@ "id": 1, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -674,7 +674,7 @@ "id": 2, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -691,7 +691,7 @@ "id": 3, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -708,7 +708,7 @@ "id": 4, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -725,7 +725,7 @@ "id": 5, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -742,7 +742,7 @@ "id": 6, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -759,7 +759,7 @@ "id": 7, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1154,7 +1154,7 @@ { "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1180,7 +1180,7 @@ "id": 0, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1197,7 +1197,7 @@ "id": 1, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1214,7 +1214,7 @@ "id": 2, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1231,7 +1231,7 @@ "id": 3, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1248,7 +1248,7 @@ "id": 4, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1265,7 +1265,7 @@ "id": 5, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1282,7 +1282,7 @@ "id": 6, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1299,7 +1299,7 @@ "id": 7, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1316,7 +1316,7 @@ "id": 8, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1363,7 +1363,7 @@ { "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1389,7 +1389,7 @@ "id": 0, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1406,7 +1406,7 @@ "id": 1, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1453,7 +1453,7 @@ { "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1479,7 +1479,7 @@ "id": 0, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { @@ -1496,7 +1496,7 @@ "id": 1, "physicalLocation": { "artifactLocation": { - "uri": "Modules/modules.php", + "uri": "Modules/functions.php", "uriBaseId": "%SRCROOT%" }, "region": { diff --git a/.version b/.version index b59fc6c..ef7e2d3 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -{ "BRANCH": "main", "VERSION":"1.1.10" } \ No newline at end of file +{ "BRANCH": "dev", "VERSION":"1.1.10-dev" } \ No newline at end of file diff --git a/Modules/modules.php b/Modules/functions.php similarity index 100% rename from Modules/modules.php rename to Modules/functions.php diff --git a/index.php b/index.php index 13db09f..61d4273 100644 --- a/index.php +++ b/index.php @@ -7,37 +7,37 @@ /* Initialise Displays */ if ($url == "dataProcessing") { /* Form Submission Handler */ - require("./Modules/modules.php"); + require("./Modules/functions.php"); require("./Public/dataProcessing.php"); return; } if ($url == "view") { /* View Message Page */ - require("./Modules/modules.php"); + require("./Modules/functions.php"); require("./Public/view.php"); return; } if ($url == "") { /* Primary Display Page */ - require("./Modules/modules.php"); + require("./Modules/functions.php"); setupStorageMethod(); // Check database require("./Public/index.php"); } elseif ($url == "404") { /* Not Found Page */ - require("./Modules/modules.php"); + require("./Modules/functions.php"); return require("./Public/error/404.php"); } elseif ($url == "403") { /* Not Found Page */ - require("./Modules/modules.php"); + require("./Modules/functions.php"); return require("./Public/error/403.php"); } else { if ($url == "500") { /* Server Error Page */ - require("./Modules/modules.php"); + require("./Modules/functions.php"); return require("./Public/error/500.php"); } else { /* Not Found Page */ - require("./Modules/modules.php"); + require("./Modules/functions.php"); return require("./Public/error/404.php"); } } From 315def7982c66d2f8ade28d9ebbd3da5766d1978 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 13:07:57 +0100 Subject: [PATCH 03/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Brendan Price <56489848+brendanprice2003@users.noreply.github.com> --- Modules/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/functions.php b/Modules/functions.php index ac159a2..7c22ba7 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -70,6 +70,8 @@ function decryptData($encryption_key) // getRecord("encrypted_contents", $dataKe function setupStorageMethod() { /* Prerequisites */ + if (!is_dir("./local-storage/")) mkdir("./local-storage/"); + if (!file_exists("./local-storage/.cache")) file_put_contents("./local-storage/.cache", '{"DO-NOT-TOUCH:database_installation_status": "false"}');; $cache = json_decode(file_get_contents("./local-storage/.cache", true), true); $configuration = json_decode(file_get_contents("./.config", true), true); /* End Prerequisites */ @@ -124,8 +126,6 @@ function setupStorageMethod() require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials die(); } else { - if (!is_dir("./local-storage/")) mkdir("./local-storage/"); - if (!file_exists("./local-storage/.cache")) file_put_contents("./local-storage/.cache", '{"DO-NOT-TOUCH:database_installation_status": "false"}');; $cache = json_decode(file_get_contents("./local-storage/.cache"), true); if ($cache["DO-NOT-TOUCH:database_installation_status"] == "false") { $tableCreateSQL = "CREATE TABLE IF NOT EXISTS `quickblaze_records` (`record_id` int(11) NOT NULL, `encrypted_contents` longtext NOT NULL, `encryption_token` varchar(128) NOT NULL, `source_ip` varchar(100) NOT NULL, `record_date` timestamp(5) NOT NULL DEFAULT current_timestamp(5)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; From af41f894e9cdf325b4b9946348b6f8453bf3fe3c Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 13:11:07 +0100 Subject: [PATCH 04/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Brendan Price <56489848+brendanprice2003@users.noreply.github.com> --- Modules/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/functions.php b/Modules/functions.php index 7c22ba7..0c6764a 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -100,7 +100,7 @@ function setupStorageMethod() } else{ $TEMP_DEBUGMODE = $configuration["DEBUG_MODE"]; } - file_put_contents("./.config", json_encode(array("STORAGE_METHOD" => "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$path", "DEBUG_MODE" => $TEMP_DEBUGMODE))); // Set contents of new config file + file_put_contents("./.config", json_encode(array("STORAGE_METHOD" => "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$path", "DEBUG_MODE" => "$TEMP_DEBUGMODE"))); // Set contents of new config file } if (strtolower($configuration["LANGUAGE"]) == "") { require "./Public/error/ServerConfiguration.php"; // throw error page if no language is provided From ad704da60be19ea7782d5a626a053e5fab821903 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 13:50:36 +0100 Subject: [PATCH 05/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Brendan Price <56489848+brendanprice2003@users.noreply.github.com> --- Modules/functions.php | 174 ++++++++++-------- Public/{Error => error_docs}/403.php | 0 Public/{Error => error_docs}/404.php | 0 Public/{Error => error_docs}/500.php | 0 .../{Error => error_docs}/DatabaseConfig.php | 0 .../DatabaseCredentials.php | 0 .../ServerConfiguration.php | 0 index.php | 10 +- 8 files changed, 102 insertions(+), 82 deletions(-) rename Public/{Error => error_docs}/403.php (100%) rename Public/{Error => error_docs}/404.php (100%) rename Public/{Error => error_docs}/500.php (100%) rename Public/{Error => error_docs}/DatabaseConfig.php (100%) rename Public/{Error => error_docs}/DatabaseCredentials.php (100%) rename Public/{Error => error_docs}/ServerConfiguration.php (100%) diff --git a/Modules/functions.php b/Modules/functions.php index 0c6764a..dbbb50f 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -1,4 +1,5 @@ - "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$path", "DEBUG_MODE" => "$TEMP_DEBUGMODE"))); // Set contents of new config file - } - if (strtolower($configuration["LANGUAGE"]) == "") { - require "./Public/error/ServerConfiguration.php"; // throw error page if no language is provided - die(); - } - if (strtolower($configuration["DEBUG_MODE"]) == "") { - require "./Public/error/ServerConfiguration.php"; // throw error page if no language is provided - die(); + + /* Config File If Empty Validation*/ + if ($configuration["STORAGE_METHOD"] == "") { + file_put_contents("./.config", json_encode(array("STORAGE_METHOD" => "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$TEMP_PATH", "DEBUG_MODE" => "$TEMP_DEBUGMODE"))); // Set contents of new config file + } + if ($configuration["INSTALLATION_PATH"] == "") { + file_put_contents("./.config", json_encode(array("STORAGE_METHOD" => "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$TEMP_PATH", "DEBUG_MODE" => "$TEMP_DEBUGMODE"))); // Set contents of new config file + } + if ($configuration["LANGUAGE"] == "") { + file_put_contents("./.config", json_encode(array("STORAGE_METHOD" => "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$TEMP_PATH", "DEBUG_MODE" => "$TEMP_DEBUGMODE"))); // Set contents of new config file + } + if ($configuration["DEBUG_MODE"] == "") { + file_put_contents("./.config", json_encode(array("STORAGE_METHOD" => "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$TEMP_PATH", "DEBUG_MODE" => "$TEMP_DEBUGMODE"))); // Set contents of new config file + } } - if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") { - if (!file_exists("./Modules/Database.env")) { - touch("./Modules/Database.env"); // Create file - require "./Public/error/DatabaseConfig.php"; - die(); - } else { - $json = json_decode(file_get_contents("./Modules/Database.env", true), true); - if ($json["DATABASE"] == "" || $json["HOSTNAME"] == "") { + function setupStorageMethod() + { + $cache = json_decode(file_get_contents("./local-storage/.cache", true), true); + $configuration = json_decode(file_get_contents("./.config", true), true); + + if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") { + if (!file_exists("./Modules/Database.env")) { + touch("./Modules/Database.env"); // Create database configuration file require "./Public/error/DatabaseConfig.php"; die(); - } else { // Test database connection - $conn = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]); - if ($conn->connect_error) { - require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials + } else { + $json = json_decode(file_get_contents("./Modules/Database.env", true), true); + if ($json["DATABASE"] == "" || $json["HOSTNAME"] == "") { + require "./Public/error/DatabaseConfig.php"; die(); - } else { - $cache = json_decode(file_get_contents("./local-storage/.cache"), true); - if ($cache["DO-NOT-TOUCH:database_installation_status"] == "false") { - $tableCreateSQL = "CREATE TABLE IF NOT EXISTS `quickblaze_records` (`record_id` int(11) NOT NULL, `encrypted_contents` longtext NOT NULL, `encryption_token` varchar(128) NOT NULL, `source_ip` varchar(100) NOT NULL, `record_date` timestamp(5) NOT NULL DEFAULT current_timestamp(5)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; - $addPrimaryKeySQL = "ALTER TABLE `quickblaze_records` ADD PRIMARY KEY (`record_id`);"; - if ($conn->query($tableCreateSQL)) { - if ($conn->query($addPrimaryKeySQL)) { - file_put_contents("./local-storage/.cache", '{"DO-NOT-TOUCH:database_installation_status": "true"}'); + } else { // Test database connection + $conn = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]); + if ($conn->connect_error) { + require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials + die(); + } else { + $cache = json_decode(file_get_contents("./local-storage/.cache"), true); + if ($cache["DO-NOT-TOUCH:database_installation_status"] == "false") { + $tableCreateSQL = "CREATE TABLE IF NOT EXISTS `quickblaze_records` (`record_id` int(11) NOT NULL, `encrypted_contents` longtext NOT NULL, `encryption_token` varchar(128) NOT NULL, `source_ip` varchar(100) NOT NULL, `record_date` timestamp(5) NOT NULL DEFAULT current_timestamp(5)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; + $addPrimaryKeySQL = "ALTER TABLE `quickblaze_records` ADD PRIMARY KEY (`record_id`);"; + if ($conn->query($tableCreateSQL)) { + if ($conn->query($addPrimaryKeySQL)) { + file_put_contents("./local-storage/.cache", '{"DO-NOT-TOUCH:database_installation_status": "true"}'); + } + } else { + require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials + die(); } - } else { - require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials + } + // Always reset auto-increment + if (!$conn->query("ALTER TABLE `quickblaze_records` MODIFY `record_id` int(11) NOT NULL AUTO_INCREMENT;")) { + require "./Public/error/DatabaseConfig.php"; // throw error page if invalid credentials die(); } } - // Always reset auto-increment - if (!$conn->query("ALTER TABLE `quickblaze_records` MODIFY `record_id` int(11) NOT NULL AUTO_INCREMENT;")) { - require "./Public/error/DatabaseConfig.php"; // throw error page if invalid credentials - die(); - } + $conn->close(); } - $conn->close(); } + } elseif (strtolower($configuration["STORAGE_METHOD"]) == "filetree") { + $baseStorageFolder = "./local-storage"; + if (!is_dir("$baseStorageFolder/")) mkdir("$baseStorageFolder/"); + if (!is_dir("$baseStorageFolder/encryptions/")) mkdir("$baseStorageFolder/encryptions/"); + } else { // Server storage method not set + require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration + die(); } - } elseif (strtolower($configuration["STORAGE_METHOD"]) == "filetree") { - $baseStorageFolder = "./local-storage"; - if (!is_dir("$baseStorageFolder/")) mkdir("$baseStorageFolder/"); - if (!is_dir("$baseStorageFolder/encryptions/")) mkdir("$baseStorageFolder/encryptions/"); - } else { // Server storage method not set - require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration - die(); } - error_reporting(E_ALL); // enable error reporting + + /* Call Functions */ + createStorageMethodEndpoints(); // Setup files and folders the system will store data. + checkConfigValues(); // Validate if configuration values are correct & present. + setupStorageMethod(); // Setup how the system will store the data via the configured method. + /* End Functions */ } + +/* Database Interaction Functions */ function insertRecord($encrypted_contents, $encryption_token) { - error_reporting(0); $configuration = json_decode(file_get_contents("./.config", true), true); $json = json_decode(file_get_contents("./Modules/Database.env", true), true); if ($_SERVER['HTTP_CF_CONNECTING_IP'] == "" || !isset($_SERVER['HTTP_CF_CONNECTING_IP'])) $_SERVER['HTTP_CF_CONNECTING_IP'] = $_SERVER["REMOTE_ADDR"]; @@ -276,12 +298,10 @@ function translate($q) $configuration = json_decode(file_get_contents("./.config", true), true); if ($configuration["LANGUAGE"] == "auto") { $tl = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); + } else if ($configuration["LANGUAGE"] != "") { + $tl = $configuration["LANGUAGE"]; } else { - if ($configuration["LANGUAGE"] != "") { - $tl = $configuration["LANGUAGE"]; - } else { - $tl = "en"; - } + $tl = "en"; } $res = file_get_contents("https://translate.googleapis.com/translate_a/single?client=gtx&ie=UTF-8&oe=UTF-8&dt=bd&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&dt=t&dt=at&sl=" . $lang . "&tl=" . $tl . "&hl=hl&q=" . urlencode($q), $_SERVER['DOCUMENT_ROOT'] . "/transes.html"); $res = json_decode($res); diff --git a/Public/Error/403.php b/Public/error_docs/403.php similarity index 100% rename from Public/Error/403.php rename to Public/error_docs/403.php diff --git a/Public/Error/404.php b/Public/error_docs/404.php similarity index 100% rename from Public/Error/404.php rename to Public/error_docs/404.php diff --git a/Public/Error/500.php b/Public/error_docs/500.php similarity index 100% rename from Public/Error/500.php rename to Public/error_docs/500.php diff --git a/Public/Error/DatabaseConfig.php b/Public/error_docs/DatabaseConfig.php similarity index 100% rename from Public/Error/DatabaseConfig.php rename to Public/error_docs/DatabaseConfig.php diff --git a/Public/Error/DatabaseCredentials.php b/Public/error_docs/DatabaseCredentials.php similarity index 100% rename from Public/Error/DatabaseCredentials.php rename to Public/error_docs/DatabaseCredentials.php diff --git a/Public/Error/ServerConfiguration.php b/Public/error_docs/ServerConfiguration.php similarity index 100% rename from Public/Error/ServerConfiguration.php rename to Public/error_docs/ServerConfiguration.php diff --git a/index.php b/index.php index 61d4273..e6749b9 100644 --- a/index.php +++ b/index.php @@ -20,24 +20,24 @@ if ($url == "") { /* Primary Display Page */ require("./Modules/functions.php"); - setupStorageMethod(); // Check database + initialiseSystem(); // Call system functions to initialise require("./Public/index.php"); } elseif ($url == "404") { /* Not Found Page */ require("./Modules/functions.php"); - return require("./Public/error/404.php"); + return require("./Public/error_docs/404.php"); } elseif ($url == "403") { /* Not Found Page */ require("./Modules/functions.php"); - return require("./Public/error/403.php"); + return require("./Public/error_docs/403.php"); } else { if ($url == "500") { /* Server Error Page */ require("./Modules/functions.php"); - return require("./Public/error/500.php"); + return require("./Public/error_docs/500.php"); } else { /* Not Found Page */ require("./Modules/functions.php"); - return require("./Public/error/404.php"); + return require("./Public/error_docs/404.php"); } } From 3450c5d3d41abb7c16675cc3ff96a7d1ef841e03 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 13:58:23 +0100 Subject: [PATCH 06/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Brendan Price <56489848+brendanprice2003@users.noreply.github.com> --- .htaccess | 2 +- Public/assets/js/formContentUpdate.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.htaccess b/.htaccess index b557439..36c1a8b 100644 --- a/.htaccess +++ b/.htaccess @@ -10,7 +10,7 @@ ErrorDocument 403 /403 ErrorDocument 500 /500 # File security - + Order allow,deny Deny from all \ No newline at end of file diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index f055821..9458d8b 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -1,6 +1,6 @@ -const updateFormDisplay = () => { +function updateFormDisplay() { const formvalue = document.getElementById('inputtextbot').value; // Assign variable to the current value of the textbox - + $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); @@ -8,7 +8,7 @@ const updateFormDisplay = () => { log(`Server responsed with '${data.response}'`); document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL - log(`Updated 'submissiontextbox.value'`); + log(`Updated 'submissiontextbox.value'`); document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.innerHTML'`); @@ -17,9 +17,9 @@ const updateFormDisplay = () => { $('#form_submission').fadeIn('fast'); // fade in new content log(`Now showing 'form_submission' element`); }, 200); -}; +} -const updateViewDisplay = () => { +function updateViewDisplay() { $('#form_confirmation').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_confirmation' element`); @@ -51,4 +51,4 @@ const updateViewDisplay = () => { log(`Server responded with '${data.response}'`); }; }); -}; \ No newline at end of file +} \ No newline at end of file From 3a80864492e00726716e75d2bfa4a4592cfcd9cf Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 14:00:54 +0100 Subject: [PATCH 07/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Brendan Price <56489848+brendanprice2003@users.noreply.github.com> --- Public/assets/js/autoConfigurationChecks.js | 2 +- Public/assets/js/buttonCopyURL.js | 4 ++-- Public/assets/js/globalFunctions.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Public/assets/js/autoConfigurationChecks.js b/Public/assets/js/autoConfigurationChecks.js index 322e94a..029d62d 100644 --- a/Public/assets/js/autoConfigurationChecks.js +++ b/Public/assets/js/autoConfigurationChecks.js @@ -1,4 +1,4 @@ -const autoRecheckConfig = (pageName) => { +function autoRecheckConfig(pageName) { fetch(`dataProcessing?action=checkConfig`).then(response => response.json()).then(data => { // log(`[RE-CHECK] Server responded with ${data.response}`); if (data.response === 'true') { diff --git a/Public/assets/js/buttonCopyURL.js b/Public/assets/js/buttonCopyURL.js index b41019b..96151fa 100644 --- a/Public/assets/js/buttonCopyURL.js +++ b/Public/assets/js/buttonCopyURL.js @@ -1,4 +1,4 @@ -const copyToClipboard = (element) => { +function copyToClipboard(element) { let $temp = $(''); $('body').append($temp); $temp.val($(element).text()).select(); @@ -8,7 +8,7 @@ const copyToClipboard = (element) => { showSnackBar('snackbar'); // show snackbar notification }; -const showSnackBar = (snackbarId) => { +function showSnackBar(snackbarId) { let x = document.getElementById(snackbarId); x.className = 'show'; var time = 3000; diff --git a/Public/assets/js/globalFunctions.js b/Public/assets/js/globalFunctions.js index 70461dc..032bd95 100644 --- a/Public/assets/js/globalFunctions.js +++ b/Public/assets/js/globalFunctions.js @@ -18,7 +18,7 @@ document.addEventListener('DOMContentLoaded', function () { function log(content, type = null) { fetch(`dataProcessing?action=isDebugMode`).then(response => response.json()).then(data => { - if(data.response == "true"){ + if (data.response == "true") { if (!type) { console.log( `[${moment().format('hh:mm:ss')}] [Site Debug/INFO] ${content}` @@ -28,7 +28,7 @@ function log(content, type = null) { `[${moment().format('hh:mm:ss')}] [${type}] ${content}` ); } - } else{ + } else { console.log( `[${moment().format('hh:mm:ss')}] [Initialisation/DEBUG] Debug mode is disabled!` ); From 1b0c4d80af42add2fc7a1ae9630b5a129c1fb1c9 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 14:02:19 +0100 Subject: [PATCH 08/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/globalFunctions.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Public/assets/js/globalFunctions.js b/Public/assets/js/globalFunctions.js index 032bd95..3de8f36 100644 --- a/Public/assets/js/globalFunctions.js +++ b/Public/assets/js/globalFunctions.js @@ -1,4 +1,11 @@ document.addEventListener('DOMContentLoaded', function () { + fetch(`dataProcessing?action=isDebugMode`).then(response => response.json()).then(data => { + if (data.response == "false") { + console.log( + `[${moment().format('hh:mm:ss')}] [Initialisation/DEBUG] Debug mode is disabled!` + ); + } + }); log(`${moment()}`, `Initialisation/DEBUG`); log(`Successfully loaded all assets`, `Initialisation/DEBUG`); }, false); @@ -28,10 +35,6 @@ function log(content, type = null) { `[${moment().format('hh:mm:ss')}] [${type}] ${content}` ); } - } else { - console.log( - `[${moment().format('hh:mm:ss')}] [Initialisation/DEBUG] Debug mode is disabled!` - ); } }); } \ No newline at end of file From 450ec31fddf66172bfaf849c40f52d41e1075be9 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 15:52:16 +0100 Subject: [PATCH 09/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/css/style.css | 9 --------- Public/assets/js/buttonCopyURL.js | 15 +++++++-------- Public/assets/js/formContentUpdate.js | 4 ++-- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Public/assets/css/style.css b/Public/assets/css/style.css index 3d22ceb..acdd1d8 100644 --- a/Public/assets/css/style.css +++ b/Public/assets/css/style.css @@ -128,13 +128,4 @@ textarea { bottom: 0; opacity: 0; } -} - -#subheading_moto { - opacity: 0; - transition: opacity 1000ms; -} - -#subheading_moto.show { - opacity: 1; } \ No newline at end of file diff --git a/Public/assets/js/buttonCopyURL.js b/Public/assets/js/buttonCopyURL.js index 96151fa..cc6bc9a 100644 --- a/Public/assets/js/buttonCopyURL.js +++ b/Public/assets/js/buttonCopyURL.js @@ -3,15 +3,14 @@ function copyToClipboard(element) { $('body').append($temp); $temp.val($(element).text()).select(); document.execCommand('copy'); + showSnackBar('snackbar'); // show snackbar notification log(`Copied text to clipboard`); $temp.remove(); - showSnackBar('snackbar'); // show snackbar notification -}; +} function showSnackBar(snackbarId) { - let x = document.getElementById(snackbarId); - x.className = 'show'; - var time = 3000; - log(`Displaying snackbar for ${time}ms`); - setTimeout(x.className = x.className.replace('show', ''), time); -}; \ No newline at end of file + var element = document.getElementById(`${snackbarId}`); + element.className = element.className.replace('', 'show'); + log(`Displaying snackbar for ${4000}ms`); + setTimeout(function () { element.className = element.className.replace("show", ""); }, 4000); +} \ No newline at end of file diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 9458d8b..4fed545 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -4,7 +4,7 @@ function updateFormDisplay() { $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); - fetch(`dataProcessing?data=${formvalue}`).then(response => response.json()).then(data => { + fetch(`../dataProcessing?data=${formvalue}`).then(response => response.json()).then(data => { log(`Server responsed with '${data.response}'`); document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL @@ -26,7 +26,7 @@ function updateViewDisplay() { let key = new URL(window.location).searchParams.get('key'); // Get key variable from URL; replacing PHP usage log(`Got key variable from url -> ${key}`); - fetch(`dataProcessing?action=decrypt&key=${key}`).then(response => response.json()).then(data => { + fetch(`../dataProcessing?action=decrypt&key=${key}`).then(response => response.json()).then(data => { if (!data.response) { showSnackBar('snackbarError'); From 23476c59f04ce33ffa8c9d68a10a26b5873e1894 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 15:55:50 +0100 Subject: [PATCH 10/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/dataProcessing.php | 1 + index.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Public/dataProcessing.php b/Public/dataProcessing.php index 530a2cb..726e0f4 100644 --- a/Public/dataProcessing.php +++ b/Public/dataProcessing.php @@ -1,6 +1,7 @@ Date: Fri, 24 Jun 2022 15:57:33 +0100 Subject: [PATCH 11/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Modules/functions.php | 24 ++++++++++++------------ Public/assets/js/formContentUpdate.js | 4 ++-- index.php | 8 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Modules/functions.php b/Modules/functions.php index dbbb50f..cba9fd5 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -128,17 +128,17 @@ function setupStorageMethod() if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") { if (!file_exists("./Modules/Database.env")) { touch("./Modules/Database.env"); // Create database configuration file - require "./Public/error/DatabaseConfig.php"; + require "./Public/error_docs/DatabaseConfig.php"; die(); } else { $json = json_decode(file_get_contents("./Modules/Database.env", true), true); if ($json["DATABASE"] == "" || $json["HOSTNAME"] == "") { - require "./Public/error/DatabaseConfig.php"; + require "./Public/error_docs/DatabaseConfig.php"; die(); } else { // Test database connection $conn = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]); if ($conn->connect_error) { - require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials + require "./Public/error_docs/DatabaseCredentials.php"; // throw error page if invalid credentials die(); } else { $cache = json_decode(file_get_contents("./local-storage/.cache"), true); @@ -150,13 +150,13 @@ function setupStorageMethod() file_put_contents("./local-storage/.cache", '{"DO-NOT-TOUCH:database_installation_status": "true"}'); } } else { - require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials + require "./Public/error_docs/DatabaseCredentials.php"; // throw error page if invalid credentials die(); } } // Always reset auto-increment if (!$conn->query("ALTER TABLE `quickblaze_records` MODIFY `record_id` int(11) NOT NULL AUTO_INCREMENT;")) { - require "./Public/error/DatabaseConfig.php"; // throw error page if invalid credentials + require "./Public/error_docs/DatabaseConfig.php"; // throw error page if invalid credentials die(); } } @@ -168,7 +168,7 @@ function setupStorageMethod() if (!is_dir("$baseStorageFolder/")) mkdir("$baseStorageFolder/"); if (!is_dir("$baseStorageFolder/encryptions/")) mkdir("$baseStorageFolder/encryptions/"); } else { // Server storage method not set - require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration + require "./Public/error_docs/ServerConfiguration.php"; // throw error page if invalid configuration die(); } } @@ -189,7 +189,7 @@ function insertRecord($encrypted_contents, $encryption_token) if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") { $mysqli = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]); if ($mysqli->connect_errno) { - require "./Public/error/DatabaseCredentials.php"; + require "./Public/error_docs/DatabaseCredentials.php"; die(); } $source_ip = filter_var($_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP) ?? filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP); @@ -208,7 +208,7 @@ function insertRecord($encrypted_contents, $encryption_token) $source_ip = filter_var($_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP) ?? filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP); $record_date = date("Y-m-d H:i:s"); file_put_contents("$baseStorageFolder/encryptions/$uniqueIdentifier/data.json", '{"filestore_id": "' . $uniqueIdentifier . '", "encrypted_contents": "' . $encrypted_contents . '", "encryption_token": "' . $encryption_token . '", "source_ip": "' . $source_ip . '", "record_date": "' . $record_date . '"}'); // Set data file encryption data - require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration + require "./Public/error_docs/ServerConfiguration.php"; // throw error page if invalid configuration die(); } } @@ -219,7 +219,7 @@ function destroyRecord($token) if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") { $mysqli = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]); if ($mysqli->connect_errno) { - require "./Public/error/DatabaseCredentials.php"; + require "./Public/error_docs/DatabaseCredentials.php"; die(); } $token = filter_var($token, FILTER_SANITIZE_FULL_SPECIAL_CHARS); @@ -250,7 +250,7 @@ function rmdir_recursive($dir) } } } else { // Server storage method not set - require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration + require "./Public/error_docs/ServerConfiguration.php"; // throw error page if invalid configuration die(); } } @@ -261,7 +261,7 @@ function getRecord($dataToFetch, $encryption_token) if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") { $mysqli = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]); if ($mysqli->connect_errno) { - require "./Public/error/DatabaseCredentials.php"; + require "./Public/error_docs/DatabaseCredentials.php"; die(); } $encryption_token = filter_var($encryption_token, FILTER_SANITIZE_FULL_SPECIAL_CHARS); @@ -286,7 +286,7 @@ function getRecord($dataToFetch, $encryption_token) } } } else { // Server storage method not set - require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration + require "./Public/error_docs/ServerConfiguration.php"; // throw error page if invalid configuration die(); } } diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 4fed545..9458d8b 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -4,7 +4,7 @@ function updateFormDisplay() { $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); - fetch(`../dataProcessing?data=${formvalue}`).then(response => response.json()).then(data => { + fetch(`dataProcessing?data=${formvalue}`).then(response => response.json()).then(data => { log(`Server responsed with '${data.response}'`); document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL @@ -26,7 +26,7 @@ function updateViewDisplay() { let key = new URL(window.location).searchParams.get('key'); // Get key variable from URL; replacing PHP usage log(`Got key variable from url -> ${key}`); - fetch(`../dataProcessing?action=decrypt&key=${key}`).then(response => response.json()).then(data => { + fetch(`dataProcessing?action=decrypt&key=${key}`).then(response => response.json()).then(data => { if (!data.response) { showSnackBar('snackbarError'); diff --git a/index.php b/index.php index af4b975..e6749b9 100644 --- a/index.php +++ b/index.php @@ -25,19 +25,19 @@ } elseif ($url == "404") { /* Not Found Page */ require("./Modules/functions.php"); - return require("./Public/error_docs_docs/404.php"); + return require("./Public/error_docs/404.php"); } elseif ($url == "403") { /* Not Found Page */ require("./Modules/functions.php"); - return require("./Public/error_docs_docs/403.php"); + return require("./Public/error_docs/403.php"); } else { if ($url == "500") { /* Server Error Page */ require("./Modules/functions.php"); - return require("./Public/error_docs_docs/500.php"); + return require("./Public/error_docs/500.php"); } else { /* Not Found Page */ require("./Modules/functions.php"); - return require("./Public/error_docs_docs/404.php"); + return require("./Public/error_docs/404.php"); } } From 588787a9e6ac9c37710ba2cfce966058f049b85e Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 15:59:50 +0100 Subject: [PATCH 12/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/error_docs/DatabaseConfig.php | 4 ++++ Public/error_docs/DatabaseCredentials.php | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Public/error_docs/DatabaseConfig.php b/Public/error_docs/DatabaseConfig.php index 54a108c..7067278 100644 --- a/Public/error_docs/DatabaseConfig.php +++ b/Public/error_docs/DatabaseConfig.php @@ -17,6 +17,10 @@
+
+ +
+


diff --git a/Public/error_docs/DatabaseCredentials.php b/Public/error_docs/DatabaseCredentials.php index a43ef43..8e86782 100644 --- a/Public/error_docs/DatabaseCredentials.php +++ b/Public/error_docs/DatabaseCredentials.php @@ -4,7 +4,7 @@ - + "> QuickBlaze @@ -17,6 +17,10 @@
+
+ +
+


@@ -39,4 +43,5 @@ + \ No newline at end of file From e19a14219b19dbbf20cc06d6daea4d1994b723bc Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 16:01:12 +0100 Subject: [PATCH 13/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/dataProcessing.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Public/dataProcessing.php b/Public/dataProcessing.php index 726e0f4..419bb51 100644 --- a/Public/dataProcessing.php +++ b/Public/dataProcessing.php @@ -1,7 +1,7 @@ Date: Fri, 24 Jun 2022 16:09:51 +0100 Subject: [PATCH 14/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Modules/functions.php | 3 ++- Public/assets/js/formContentUpdate.js | 10 +--------- Public/dataProcessing.php | 4 ++-- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Modules/functions.php b/Modules/functions.php index cba9fd5..3be00be 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -163,7 +163,7 @@ function setupStorageMethod() $conn->close(); } } - } elseif (strtolower($configuration["STORAGE_METHOD"]) == "filetree") { + } else if (strtolower($configuration["STORAGE_METHOD"]) == "filetree") { $baseStorageFolder = "./local-storage"; if (!is_dir("$baseStorageFolder/")) mkdir("$baseStorageFolder/"); if (!is_dir("$baseStorageFolder/encryptions/")) mkdir("$baseStorageFolder/encryptions/"); @@ -208,6 +208,7 @@ function insertRecord($encrypted_contents, $encryption_token) $source_ip = filter_var($_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP) ?? filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP); $record_date = date("Y-m-d H:i:s"); file_put_contents("$baseStorageFolder/encryptions/$uniqueIdentifier/data.json", '{"filestore_id": "' . $uniqueIdentifier . '", "encrypted_contents": "' . $encrypted_contents . '", "encryption_token": "' . $encryption_token . '", "source_ip": "' . $source_ip . '", "record_date": "' . $record_date . '"}'); // Set data file encryption data + } else { require "./Public/error_docs/ServerConfiguration.php"; // throw error page if invalid configuration die(); } diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 9458d8b..1d4ac8a 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -1,15 +1,11 @@ function updateFormDisplay() { const formvalue = document.getElementById('inputtextbot').value; // Assign variable to the current value of the textbox - $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); - - fetch(`dataProcessing?data=${formvalue}`).then(response => response.json()).then(data => { + fetch(`dataProcessing?action=submit&data=${formvalue}`).then(response => response.json()).then(data => { log(`Server responsed with '${data.response}'`); - document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.value'`); - document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.innerHTML'`); }); @@ -29,10 +25,8 @@ function updateViewDisplay() { fetch(`dataProcessing?action=decrypt&key=${key}`).then(response => response.json()).then(data => { if (!data.response) { showSnackBar('snackbarError'); - $('#form_error').fadeIn('fast'); // fade in new content log(`Now showing 'form_error' element`); - log(`Encryption not found; redirecting in 2s`); setTimeout(() => { window.location.replace('./'); // Redirect to home page @@ -40,10 +34,8 @@ function updateViewDisplay() { } else { document.getElementById('valuetextbox').value = data.response; // Set text box to decrypted message log(`Updated 'valuetextbox.value'`); - document.getElementById('valuetextbox').innerHTML = data.response; // Set text box to decrypted message log(`Updated 'valuetextbox.innerHTML'`); - setTimeout(() => { $('#form_content').fadeIn('fast'); // fade in new content log(`Now showing 'form_content' element`); diff --git a/Public/dataProcessing.php b/Public/dataProcessing.php index 419bb51..29fd44b 100644 --- a/Public/dataProcessing.php +++ b/Public/dataProcessing.php @@ -1,6 +1,6 @@ Date: Fri, 24 Jun 2022 16:35:49 +0100 Subject: [PATCH 15/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/buttonCopyURL.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Public/assets/js/buttonCopyURL.js b/Public/assets/js/buttonCopyURL.js index cc6bc9a..3f3892f 100644 --- a/Public/assets/js/buttonCopyURL.js +++ b/Public/assets/js/buttonCopyURL.js @@ -11,6 +11,6 @@ function copyToClipboard(element) { function showSnackBar(snackbarId) { var element = document.getElementById(`${snackbarId}`); element.className = element.className.replace('', 'show'); - log(`Displaying snackbar for ${4000}ms`); - setTimeout(function () { element.className = element.className.replace("show", ""); }, 4000); + log(`Displaying snackbar for ${3000}ms`); + setTimeout(function () { element.className = element.className.replace("show", ""); }, 3000); } \ No newline at end of file From 45d2d28a416930b30f74cdab8315b4e09e8d99b0 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 16:48:01 +0100 Subject: [PATCH 16/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/formContentUpdate.js | 2 +- Public/dataProcessing.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 1d4ac8a..7924371 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -2,7 +2,7 @@ function updateFormDisplay() { const formvalue = document.getElementById('inputtextbot').value; // Assign variable to the current value of the textbox $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); - fetch(`dataProcessing?action=submit&data=${formvalue}`).then(response => response.json()).then(data => { + fetch(`dataProcessing?action=submit&data=${formvalue}`).then(response => console.log(response.json())).then(data => { log(`Server responsed with '${data.response}'`); document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.value'`); diff --git a/Public/dataProcessing.php b/Public/dataProcessing.php index 29fd44b..034dee2 100644 --- a/Public/dataProcessing.php +++ b/Public/dataProcessing.php @@ -1,7 +1,7 @@ Date: Fri, 24 Jun 2022 16:50:05 +0100 Subject: [PATCH 17/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Modules/functions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Modules/functions.php b/Modules/functions.php index 3be00be..53b3f0d 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -1,4 +1,6 @@ - Date: Fri, 24 Jun 2022 16:54:08 +0100 Subject: [PATCH 18/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/formContentUpdate.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 7924371..94ec80d 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -2,13 +2,18 @@ function updateFormDisplay() { const formvalue = document.getElementById('inputtextbot').value; // Assign variable to the current value of the textbox $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); - fetch(`dataProcessing?action=submit&data=${formvalue}`).then(response => console.log(response.json())).then(data => { - log(`Server responsed with '${data.response}'`); - document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL - log(`Updated 'submissiontextbox.value'`); - document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL - log(`Updated 'submissiontextbox.innerHTML'`); - }); + fetch(`dataProcessing?action=submit&data=${formvalue}`).then((data) => { + resolve(data) + }) + .catch((error) => { + reject(error) + }).then(response => response.json()).then(data => { + log(`Server responsed with '${data.response}'`); + document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL + log(`Updated 'submissiontextbox.value'`); + document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL + log(`Updated 'submissiontextbox.innerHTML'`); + }); setTimeout(() => { $('#form_submission').fadeIn('fast'); // fade in new content log(`Now showing 'form_submission' element`); From fe935f4c087b4cf7c67f67bf39a1ed06ddc88b64 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 16:56:02 +0100 Subject: [PATCH 19/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/formContentUpdate.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 94ec80d..6cb4b0e 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -3,17 +3,15 @@ function updateFormDisplay() { $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); fetch(`dataProcessing?action=submit&data=${formvalue}`).then((data) => { - resolve(data) - }) - .catch((error) => { - reject(error) - }).then(response => response.json()).then(data => { - log(`Server responsed with '${data.response}'`); - document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL - log(`Updated 'submissiontextbox.value'`); - document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL - log(`Updated 'submissiontextbox.innerHTML'`); - }); + resolve(data); + log(`Server responsed with '${data.response}'`); + document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL + log(`Updated 'submissiontextbox.value'`); + document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL + log(`Updated 'submissiontextbox.innerHTML'`); + }).catch((error) => { + reject(error) + }); setTimeout(() => { $('#form_submission').fadeIn('fast'); // fade in new content log(`Now showing 'form_submission' element`); From 56385b69840e395551a6d8ff3ebe92fbc556f3db Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 16:59:17 +0100 Subject: [PATCH 20/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/formContentUpdate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 6cb4b0e..bc8cae0 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -10,7 +10,7 @@ function updateFormDisplay() { document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.innerHTML'`); }).catch((error) => { - reject(error) + log(error, `Error/DEBUG`) }); setTimeout(() => { $('#form_submission').fadeIn('fast'); // fade in new content From f471ca43277f83447127be6260a34a24c170bea9 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 17:22:49 +0100 Subject: [PATCH 21/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Modules/functions.php | 2 +- Public/assets/js/formContentUpdate.js | 5 ++--- Public/dataProcessing.php | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Modules/functions.php b/Modules/functions.php index 53b3f0d..737b40f 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -1,6 +1,6 @@ { - resolve(data); + fetch(`dataProcessing?action=submit&data=${formvalue}`).then(response => response.json()).then(data => { log(`Server responsed with '${data.response}'`); document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.value'`); document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.innerHTML'`); }).catch((error) => { - log(error, `Error/DEBUG`) + log(error, `Error/DEBUG`); }); setTimeout(() => { $('#form_submission').fadeIn('fast'); // fade in new content diff --git a/Public/dataProcessing.php b/Public/dataProcessing.php index 034dee2..0f81a08 100644 --- a/Public/dataProcessing.php +++ b/Public/dataProcessing.php @@ -1,6 +1,6 @@ Date: Fri, 24 Jun 2022 17:29:19 +0100 Subject: [PATCH 22/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/formContentUpdate.js | 15 ++++++++++++--- Public/assets/js/globalFunctions.js | 12 +++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 784dce6..7a52ec6 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -2,14 +2,23 @@ function updateFormDisplay() { const formvalue = document.getElementById('inputtextbot').value; // Assign variable to the current value of the textbox $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); - fetch(`dataProcessing?action=submit&data=${formvalue}`).then(response => response.json()).then(data => { + function fetchData() { + fetch(`dataProcessing?action=submit&data=${formvalue}`) + .then((response) => response.json()) + .then((responseData) => { + console.log(responseData); + return responseData; + }).catch(error => log(error, 'warn')); + // }).catch ((error) => { + // log(error, `Error/DEBUG`); + // }); + } + fetchData().then(response => { log(`Server responsed with '${data.response}'`); document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.value'`); document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.innerHTML'`); - }).catch((error) => { - log(error, `Error/DEBUG`); }); setTimeout(() => { $('#form_submission').fadeIn('fast'); // fade in new content diff --git a/Public/assets/js/globalFunctions.js b/Public/assets/js/globalFunctions.js index 3de8f36..c25a664 100644 --- a/Public/assets/js/globalFunctions.js +++ b/Public/assets/js/globalFunctions.js @@ -31,9 +31,15 @@ function log(content, type = null) { `[${moment().format('hh:mm:ss')}] [Site Debug/INFO] ${content}` ); } else { - console.log( - `[${moment().format('hh:mm:ss')}] [${type}] ${content}` - ); + if(type == "warn"){ + console.warn( + `[${moment().format('hh:mm:ss')}] ${content}` + ); + } else{ + console.log( + `[${moment().format('hh:mm:ss')}] [${type}] ${content}` + ); + } } } }); From 214e9155bab6408cea17663dcdfe0e3249c1de33 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 17:30:22 +0100 Subject: [PATCH 23/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/formContentUpdate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 7a52ec6..2eb2449 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -3,7 +3,7 @@ function updateFormDisplay() { $('#form_input').fadeOut('fast'); // fade out previous content log(`No longer showing 'form_input' element`); function fetchData() { - fetch(`dataProcessing?action=submit&data=${formvalue}`) + return fetch(`dataProcessing?action=submit&data=${formvalue}`) .then((response) => response.json()) .then((responseData) => { console.log(responseData); @@ -13,7 +13,7 @@ function updateFormDisplay() { // log(error, `Error/DEBUG`); // }); } - fetchData().then(response => { + fetchData().then(data => { log(`Server responsed with '${data.response}'`); document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.value'`); From 7566d8443b3036db6cc9a04709e0da643c74d8a3 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 18:37:49 +0100 Subject: [PATCH 24/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/assets/js/formContentUpdate.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 2eb2449..6ae3357 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -6,12 +6,8 @@ function updateFormDisplay() { return fetch(`dataProcessing?action=submit&data=${formvalue}`) .then((response) => response.json()) .then((responseData) => { - console.log(responseData); return responseData; }).catch(error => log(error, 'warn')); - // }).catch ((error) => { - // log(error, `Error/DEBUG`); - // }); } fetchData().then(data => { log(`Server responsed with '${data.response}'`); From 4639246cc99e93913e981407f9f10234f6173fc0 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 18:38:37 +0100 Subject: [PATCH 25/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Versioning=20Pat?= =?UTF-8?q?ch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.version b/.version index ef7e2d3..b59fc6c 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -{ "BRANCH": "dev", "VERSION":"1.1.10-dev" } \ No newline at end of file +{ "BRANCH": "main", "VERSION":"1.1.10" } \ No newline at end of file From 4dfdb6ccba0db8c96ff8a6ac15d43c0addf40280 Mon Sep 17 00:00:00 2001 From: Axton Date: Fri, 24 Jun 2022 18:45:57 +0100 Subject: [PATCH 26/26] =?UTF-8?q?=F0=9F=90=9B=20v1.1.10=20Minor=20Commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- Public/assets/js/formContentUpdate.js | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index 9006be8..74546cf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Axtonprice, QuickBlaze +Copyright (c) 2022 axtonprice, QuickBlaze Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Public/assets/js/formContentUpdate.js b/Public/assets/js/formContentUpdate.js index 2a86bef..6ae3357 100644 --- a/Public/assets/js/formContentUpdate.js +++ b/Public/assets/js/formContentUpdate.js @@ -16,8 +16,9 @@ function updateFormDisplay() { document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL log(`Updated 'submissiontextbox.innerHTML'`); }); - setTimeout(function () { - $('#form_submission').fadeIn('fast'); log(`Now showing 'form_submission' element`); // fade in new content + setTimeout(() => { + $('#form_submission').fadeIn('fast'); // fade in new content + log(`Now showing 'form_submission' element`); }, 200); } @@ -28,11 +29,8 @@ function updateViewDisplay() { let key = new URL(window.location).searchParams.get('key'); // Get key variable from URL; replacing PHP usage log(`Got key variable from url -> ${key}`); -function updateViewDisplay() { - $('#form_confirmation').fadeOut('fast'); log(`No longer showing 'form_confirmation' element`); // fade out previous content - var key = new URL(window.location).searchParams.get("key"); log(`Got key variable from url -> ${key}`); // Get key variable from URL; replacing PHP usage fetch(`dataProcessing?action=decrypt&key=${key}`).then(response => response.json()).then(data => { - if (data.response == "") { + if (!data.response) { showSnackBar('snackbarError'); $('#form_error').fadeIn('fast'); // fade in new content log(`Now showing 'form_error' element`); @@ -50,11 +48,6 @@ function updateViewDisplay() { log(`Now showing 'form_content' element`); }, 200); log(`Server responded with '${data.response}'`); - document.getElementById("valuetextbox").value = data.response; log(`Updated 'valuetextbox.value'`); // Set text box to decrypted message - document.getElementById("valuetextbox").innerHTML = data.response; log(`Updated 'valuetextbox.innerHTML'`); // Set text box to decrypted message - setTimeout(function () { - $('#form_content').fadeIn('fast'); log(`Now showing 'form_content' element`); // fade in new content - }, 200); - } + }; }); } \ No newline at end of file