From e110b86de2a8547adb2d0a7d3dd959cb9bd333d3 Mon Sep 17 00:00:00 2001 From: Fabian Schieder Date: Mon, 30 Mar 2026 19:02:37 +0200 Subject: [PATCH] Refactor account.php for improved readability and consistency in code structure --- account.php | 189 +++++++++++++++++++++++++++------------------------- 1 file changed, 100 insertions(+), 89 deletions(-) diff --git a/account.php b/account.php index 7934150..fc00ac5 100644 --- a/account.php +++ b/account.php @@ -2,8 +2,7 @@ require_once __DIR__ . '/lib/bootstrap.php'; -if (empty($_SESSION['user_id'])) -{ +if (empty($_SESSION['user_id'])) { header('Location: login.php'); exit(); } @@ -23,20 +22,16 @@ $stmt->execute(); $result = $stmt->get_result(); -if ($result) -{ +if ($result) { $user = mysqli_fetch_assoc($result); -} -else -{ +} else { $user = null; } $stmt->close(); $conn->close(); -if (!$user) -{ +if (!$user) { session_unset(); session_destroy(); header('Location: login.php'); @@ -46,94 +41,110 @@ if (!$user) include 'header.php'; ?> -
- +
\ No newline at end of file