51 lines
1.5 KiB
PHP
51 lines
1.5 KiB
PHP
<?php
|
||
session_start();
|
||
$config = require __DIR__ . '/../config.php';
|
||
$debug_output = false;
|
||
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>';
|
||
header('Location: auth.php');
|
||
exit;
|
||
}
|
||
|
||
// The user is logged in – display the attributes
|
||
$name = $_SESSION['name'] ?? 'unknown';
|
||
$email = $_SESSION['email'] ?? 'unknown';
|
||
$groups = $_SESSION['groups'] ?? [];
|
||
|
||
|
||
|
||
if ($debug_output) {
|
||
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>';
|
||
?>
|
||
|
||
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<title>Fitness Tracker</title>
|
||
<link rel="stylesheet" href="https://cosmostat.matt-cloud.com/src/styles.css">
|
||
<style>
|
||
body { font-family: Arial, sans-serif; margin: 2rem; }
|
||
#search { margin-bottom: 1rem; padding: 0.5rem; width: 300px; }
|
||
table { width: 100%; border-collapse: collapse; }
|
||
img { max-width: 60px; height: auto; }
|
||
.header-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<?php
|
||
|
||
include_once('list_providers.php');
|
||
?>
|
||
</body>
|
||
</html>
|