1e versie

This commit is contained in:
2025-11-12 10:17:30 +01:00
commit 6b5f9abec7
10 changed files with 255 additions and 0 deletions

33
public/login.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
session_start();
require_once __DIR__ . '/../includes/ldap.php';
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$user = $_POST['username'] ?? '';
$pass = $_POST['password'] ?? '';
if (ldap_authenticate($user, $pass)) {
$_SESSION['user'] = $user;
header('Location: dashboard.php');
exit;
} else {
$error = 'Ongeldige login.';
}
}
?>
<!DOCTYPE html>
<html>
<head><title>Login</title></head>
<body>
<h2>Login</h2>
<form method="post">
<label>Gebruikersnaam: <input type="text" name="username"></label><br>
<label>Wachtwoord: <input type="password" name="password"></label><br>
<button type="submit">Aanmelden</button>
</form>
<p style="color:red"><?= htmlspecialchars($error) ?></p>
</body>
</html>