diff options
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 |
