From 3409e1b5cf458ef2947c55da7451c060a063bd0c Mon Sep 17 00:00:00 2001 From: Christian Moyzyczyk Date: Sun, 15 Dec 2024 11:28:58 +0100 Subject: [PATCH] Add Active checkbox to vehicle list and hide Subscribe link for inactive cars --- TeslaLogger/bin/language-de.txt | 1 + TeslaLogger/bin/language-en.txt | 1 + TeslaLogger/www/admin/password.php | 7 ++++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/TeslaLogger/bin/language-de.txt b/TeslaLogger/bin/language-de.txt index 310dfabc7..b961a6e4e 100644 --- a/TeslaLogger/bin/language-de.txt +++ b/TeslaLogger/bin/language-de.txt @@ -169,6 +169,7 @@ Subscribe="Abo abschließen" SubscribeManage="Abo verwalten" SubscriptionRequired="Abo notwendig!" FleetAPIRequired="Fleet API notwendig!" +Aktiv="Aktiv" #password_fleet.php PF_LOGOUT="Melden Sie sich von Ihrem Tesla-Konto ab, wenn Sie bereits eingeloggt sind" diff --git a/TeslaLogger/bin/language-en.txt b/TeslaLogger/bin/language-en.txt index 59a4a627d..b44b3f6fd 100644 --- a/TeslaLogger/bin/language-en.txt +++ b/TeslaLogger/bin/language-en.txt @@ -267,6 +267,7 @@ Subscribe="Subscribe" SubscribeManage="Manage" SubscriptionRequired="Subscription Required!" FleetAPIRequired="Fleet API Required!" +Aktiv="Active" #password_fleet.php PF_LOGOUT="Log out from your Tesla account if logged in already" diff --git a/TeslaLogger/www/admin/password.php b/TeslaLogger/www/admin/password.php index 621068859..8f58e47ac 100644 --- a/TeslaLogger/www/admin/password.php +++ b/TeslaLogger/www/admin/password.php @@ -433,6 +433,7 @@ function GetTokensFromURL() + Fleet API Virtual Key @@ -454,6 +455,7 @@ function GetTokensFromURL() $vin = $v->{"vin"}; $tesla_carid = $v->{"tesla_carid"}; $access_type = $v->{"access_type"}; + $inactive = $v->{"inactive"} == 1; $cartype = $v->{"car_type"}; $NeedSubscription = !($cartype === "models" || $cartype === "modelx" || $cartype === "models2"); @@ -468,12 +470,15 @@ function GetTokensFromURL() $virtualKeyCheckBox = GetCheckbox($v->{"virtualkey"}); + $activeCheckBox = GetCheckbox(!$inactive); + echo(" \r\n"); echo(" $id\r\n"); echo(" $display_name \r\n"); echo(" $car\r\n"); echo(" $vin\r\n"); echo(" $tasker_token\r\n"); + echo(" $activeCheckBox\r\n"); echo(" $freesuccheckbox\r\n"); echo(" $fleetAPICheckBox\r\n"); echo(" $virtualKeyCheckBox\r\n"); @@ -485,7 +490,7 @@ function GetTokensFromURL() echo("\r\n"); echo(" "); - if ($NeedSubscription) + if ($NeedSubscription && !$inactive) { $subscription = file_get_contents("https://teslalogger.de/stripe/subscription-check.php?vin=$vin");