From 146774a4ed1fca946fcc24d66dcca7ffe21dcd72 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sun, 12 Jun 2022 22:38:03 +0200 Subject: Working around a bug --- Application/AddTransaction/index.php | 1 + Application/RemoveTransaction/index.php | 1 + Authentication/Mobile/index.php | 4 +++ Authentication/MobileCallback/index.php | 63 +++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 Authentication/Mobile/index.php create mode 100644 Authentication/MobileCallback/index.php diff --git a/Application/AddTransaction/index.php b/Application/AddTransaction/index.php index 1c3d35f..e6b7d34 100644 --- a/Application/AddTransaction/index.php +++ b/Application/AddTransaction/index.php @@ -79,4 +79,5 @@ if ($_GET['Currency'] === "€") { $list = array_reverse($list); +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions." . str_replace(":", "-", date('c')) . ".json", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions.json")); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions.json", json_encode($list)); \ No newline at end of file diff --git a/Application/RemoveTransaction/index.php b/Application/RemoveTransaction/index.php index ad0ed5d..138f6a8 100644 --- a/Application/RemoveTransaction/index.php +++ b/Application/RemoveTransaction/index.php @@ -49,4 +49,5 @@ $list = array_filter($list, function ($item) { return ($item["date"] !== base64url_decode($_GET['Transaction'])); }); +file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions." . str_replace(":", "-", date('c')) . ".json", file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions.json")); file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Transactions.json", json_encode($list)); \ No newline at end of file diff --git a/Authentication/Mobile/index.php b/Authentication/Mobile/index.php new file mode 100644 index 0000000..5811228 --- /dev/null +++ b/Authentication/Mobile/index.php @@ -0,0 +1,4 @@ + 0, + 'path' => '/', + 'domain' => "", + 'secure' => true, + 'httponly' => true, + 'samesite' => 'None' + ]); + setcookie("BITS_SESSION_TOKEN", $token, 0, "/", "", true, true); + header("Set-Cookie: BITS_SESSION_TOKEN=" . $token . "; SameSite=None; Path=/; Secure; HttpOnly"); + + header("Location: /Mobile"); + } else { + header("Location: /Authentication/Disallowed"); + } + + die(); +} \ No newline at end of file -- cgit