diff options
| author | ilotterytea <iltsu@alright.party> | 2025-08-16 18:32:00 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-08-16 18:32:00 +0500 |
| commit | 25b5223e4b60afa56342db96091797954655df7c (patch) | |
| tree | a294a4da0e1dda4282f86685c8993715a1c4d4fc /lib | |
| parent | b65f988200231ee264337d229f4445038e027d1e (diff) | |
feat: display user status in the header
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/partials.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/partials.php b/lib/partials.php index e11e194..89ce1cf 100644 --- a/lib/partials.php +++ b/lib/partials.php @@ -1,11 +1,24 @@ <?php function html_navbar() { + session_start(); + $user = $_SESSION['user'] ?? null; echo '' ?> <header> <a href="/"> - <img src="/static/brand/big.webp" alt="ilt.su"> + <img src="/static/img/brand/big.webp" alt="ilt.su"> </a> + <?php if (isset($user)): ?> + <div class="row gap-8 align-center"> + <p>Signed in as <b><?= $user['username'] ?></b></p> + <a href="/account/edit.php"><img src="/static/img/icons/settings.png" alt="Settings" + title="Account settings..."></a> + <a href="/account/logout.php"><img src="/static/img/icons/logout.png" alt="Logout" + title="Logout from the account"></a> + </div> + <?php else: ?> + <a href="/login.php">Log in</a> + <?php endif; ?> </header> <?php ; }
\ No newline at end of file |
