From f70cf5893bb775625e79ed959721ede03e34a108 Mon Sep 17 00:00:00 2001 From: Minteck Date: Mon, 11 Jul 2022 18:54:47 +0200 Subject: Update --- Application/AddTransaction/index.php | 9 +++++++-- Application/SetCurrentIdentity/index.php | 22 ++++++++++++++++++++++ Application/SetDefaultIdentity/index.php | 13 +++++++++++++ Application/TransactionsList/index.php | 4 ++-- 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 Application/SetCurrentIdentity/index.php create mode 100644 Application/SetDefaultIdentity/index.php (limited to 'Application') diff --git a/Application/AddTransaction/index.php b/Application/AddTransaction/index.php index ef2f339..2a56696 100644 --- a/Application/AddTransaction/index.php +++ b/Application/AddTransaction/index.php @@ -45,6 +45,7 @@ if (!isset($_GET['Currency']) || !isset($_GET['Amount']) || !is_numeric($_GET['A $transaction = []; $exchangeRate = (float)file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/ExchangeRate.txt"); +$identities = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/Private/Data/Identities.json"), true); $eurToGbp = $exchangeRate; $gbpToEur = 1 / $eurToGbp; @@ -59,7 +60,9 @@ if ($_GET['Currency'] === "€") { 'original' => 'eur' ], 'date' => date("c"), - 'description' => base64url_decode($_GET['Description']) + 'description' => base64url_decode($_GET['Description']), + 'name' => $identities[$_PROFILE["id"]]["name"], + 'picture' => $identities[$_PROFILE["id"]]["picture"] ]; } else { $transaction = [ @@ -71,7 +74,9 @@ if ($_GET['Currency'] === "€") { 'original' => 'gbp' ], 'date' => date("c"), - 'description' => base64url_decode($_GET['Description']) + 'description' => base64url_decode($_GET['Description']), + 'name' => $identities[$_PROFILE["id"]]["name"], + 'picture' => $identities[$_PROFILE["id"]]["picture"] ]; } diff --git a/Application/SetCurrentIdentity/index.php b/Application/SetCurrentIdentity/index.php new file mode 100644 index 0000000..d7603dd --- /dev/null +++ b/Application/SetCurrentIdentity/index.php @@ -0,0 +1,22 @@ + $item["author"], - "name" => $users[$item["author"]] ?? $item["author"], - "avatar" => "https://account.minteck.org/hub/api/rest/avatar/" . $item["author"] . "?dpr=2&size=48" + "name" => $item["name"] ?? $users[$item["author"]] ?? $item["author"], + "avatar" => $item["picture"] ?? "https://privateauth.equestria.dev/hub/api/rest/avatar/" . $item["author"] . "?dpr=2&size=48" ]; $item["date"] = [ "absolute" => $item["date"], -- cgit