Files
Fitness/web/index.php
T

23 lines
757 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
session_start();
$config = require __DIR__ . 'config.php';
if (!isset($_SESSION['authenticated'])) {
// User not logged in – show a login button
echo '<h1>Welcome to the demo</h1>';
echo '<p><a href="auth.php">Login with Authelia SSO</a></p>';
exit;
}
// The user is logged in – display the attributes
$name = $_SESSION['name'] ?? 'unknown';
$email = $_SESSION['email'] ?? 'unknown';
$groups = $_SESSION['groups'] ?? [];
echo '<h1>Logged in as ' . htmlspecialchars($name) . '</h1>';
echo '<ul>';
echo '<li><strong>Email:</strong> ' . htmlspecialchars($email) . '</li>';
echo '<li><strong>Groups:</strong> ' . htmlspecialchars(implode(', ', $groups)) . '</li>';
echo '</ul>';
echo '<p><a href="logout.php">Logout</a></p>';