feat: Implement secure authentication module and integrate session management across multiple files

This commit is contained in:
2026-09-07 13:30:55 +02:00
parent 6d6833a417
commit 530e249b8f
6 changed files with 404 additions and 6 deletions
+8 -3
View File
@@ -4,6 +4,9 @@
* Hoofdpagina voor status, runtime verificatie en Git webhook deployment tests.
*/
require_once __DIR__ . '/auth.php';
require_auth();
// Snelle API responder voor AJAX pings
if (isset($_GET['api']) && $_GET['api'] === 'status') {
header('Content-Type: application/json; charset=utf-8');
@@ -23,9 +26,10 @@ date_default_timezone_set('Europe/Amsterdam');
$serverTime = date('d-m-Y H:i:s');
$phpVersion = PHP_VERSION;
$serverSoftware = $_SERVER['SERVER_SOFTWARE'] ?? 'Apache / Nginx';
$host = $_SERVER['HTTP_HOST'] ?? 'www.webenpcstudio.nl';
$host = $_SERVER['HTTP_HOST'] ?? 'server.webenpcstudio.nl';
$clientIp = $_SERVER['REMOTE_ADDR'] ?? 'Onbekend';
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'HTTPS' : 'HTTP';
$loggedUser = $_SESSION['wpc_user_email'] ?? 'niek.rabelink@gmail.com';
// Git repository inspectie (met veilige fallback)
$activeBranch = 'dev';
@@ -91,9 +95,10 @@ if (empty($commits)) {
</div>
<div class="nav-status">
<button class="btn btn-secondary btn-sm theme-btn" onclick="toggleTheme()">🌙 Thema</button>
<a href="logout.php" class="btn btn-secondary btn-sm" style="color: #f87171;" title="Veilig uitloggen">🚪 Uitloggen</a>
<span class="nav-badge">
<span class="pulse-dot"></span>
Git Live
server.webenpcstudio.nl
</span>
</div>
</nav>
@@ -102,7 +107,7 @@ if (empty($commits)) {
<header class="hero">
<h1>Systeem Dashboard &amp; Git Status</h1>
<p>
Realtime omgevingsstatus, Git webhook deploy-verificatie en server-runtime monitoring voor www.webenpcstudio.nl.
Realtime omgevingsstatus, Git webhook deploy-verificatie en server-runtime monitoring voor <strong>server.webenpcstudio.nl</strong>.
</p>
</header>