Stack: Nginx + PHP 8.2 + MariaDB + Postfix + Dovecot + Samba - install.sh: script installation automatisé pour RPi OS Bookworm - Interface web: visionneuse mails + admin (comptes, domaine, dashboard) - Chaque compte mail génère automatiquement un share Samba - Processeur cron: extraction pièces jointes via zbateson/mail-mime-parser - Zéro injection SQL (PDO + prepared statements) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53 lines
1.8 KiB
PHP
53 lines
1.8 KiB
PHP
<?php
|
|
require_once __DIR__ . '/includes/db.php';
|
|
require_once __DIR__ . '/includes/auth.php';
|
|
require_once __DIR__ . '/includes/layout.php';
|
|
|
|
auth_start();
|
|
|
|
if (!empty($_SESSION['admin_id'])) {
|
|
header('Location: /');
|
|
exit;
|
|
}
|
|
|
|
$error = '';
|
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
$username = trim($_POST['username'] ?? '');
|
|
$password = $_POST['password'] ?? '';
|
|
if (auth_login($username, $password)) {
|
|
header('Location: /');
|
|
exit;
|
|
}
|
|
$error = 'Identifiants incorrects.';
|
|
}
|
|
|
|
html_head('Connexion');
|
|
?>
|
|
<div class="min-vh-100 d-flex align-items-center justify-content-center bg-light">
|
|
<div class="card shadow" style="width:360px">
|
|
<div class="card-body p-4">
|
|
<div class="text-center mb-4">
|
|
<i class="bi bi-envelope-arrow-down-fill text-primary" style="font-size:2.5rem"></i>
|
|
<h4 class="mt-2 fw-bold">CopyMail</h4>
|
|
</div>
|
|
<?php if ($error): ?>
|
|
<div class="alert alert-danger py-2"><i class="bi bi-exclamation-triangle-fill me-1"></i><?= htmlspecialchars($error) ?></div>
|
|
<?php endif; ?>
|
|
<form method="post">
|
|
<div class="mb-3">
|
|
<label class="form-label">Nom d'utilisateur</label>
|
|
<input type="text" name="username" class="form-control" autofocus required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label class="form-label">Mot de passe</label>
|
|
<input type="password" name="password" class="form-control" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary w-100">
|
|
<i class="bi bi-box-arrow-in-right me-1"></i>Connexion
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php html_foot(); ?>
|