From 4752296add769dae0f2dcf4486dec21eee026c04 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 10 May 2025 18:39:00 +0500 Subject: feat: user connections --- public/account/index.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'public/account/index.php') diff --git a/public/account/index.php b/public/account/index.php index 48bfb8d..97c5942 100644 --- a/public/account/index.php +++ b/public/account/index.php @@ -135,6 +135,58 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
+
+

Connections

+
+ prepare("SELECT * FROM connections WHERE user_id = ?"); + $stmt->execute([$_SESSION["user_id"]]); + $connections = $stmt->fetchAll(); + $platforms = ["twitch"]; + + foreach ($platforms as $platform) { + $connection = null; + $key = array_search($platform, array_column($connections, "platform")); + + if (!is_bool($key)) { + $connection = $connections[$key]; + } + + echo "
"; + echo "
"; + + echo "
"; + echo "" . ucfirst($platform) . ""; + + // TODO: check if connection is still alive + if ($connection == null) { + echo "Not connected"; + } else { + echo "" . $connection["alias_id"] . ""; + } + + echo "
"; + + echo "
"; + + if ($connection == null) { + echo ""; + echo 'Connect'; + echo ""; + } else { + echo ""; + echo 'Disconnect'; + echo ""; + } + + echo "
"; + } + ?> +
+
+ +
+

Security & Privacy

-- cgit v1.2.3