intranet-apei/activate.php
2026-03-13 17:09:52 +01:00

103 lines
No EOL
2.6 KiB
PHP

<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
//Verif
function useRegex($input, $regex)
{
return preg_match($regex, $input);
}
if(useRegex($_POST['user'], '/^APEI\d{4}$/') && useRegex($_POST['mail'], '/^[a-zA-Z0-9._%+-]+@apeimbge\.fr$/')){
header('location: ./Assets/sendMail.php?type=0&user=' . $_POST['user'] . '&email=' . htmlspecialchars($_POST['mail']));
exit;
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Activer mon compte</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
background: #f5f7fa;
}
.card {
border-radius: 15px;
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}
.title {
font-weight: 600;
}
.note {
font-size: 0.9rem;
color: #6c757d;
}
</style>
</head>
<body class="d-flex align-items-center justify-content-center vh-100">
<div class="container" style="max-width:500px;">
<div class="card p-4">
<h1 class="h4 text-center mb-4 title">
Activer mon compte sur l'intranet
</h1>
<form method="post">
<div class="mb-3">
<label for="user" class="form-label">
Nom d'utilisateur
</label>
<input
type="text"
class="form-control"
name="user"
id="user"
placeholder="APEIXXXX"
required>
</div>
<div class="mb-3">
<label for="mail" class="form-label">
Adresse mail
</label>
<input
type="email"
class="form-control"
name="mail"
id="mail"
placeholder="pcharlot@apeimbge.fr"
required>
</div>
<div class="d-grid">
<button type="submit" class="btn btn-primary">
Demander l'activation
</button>
</div>
</form>
<p class="text-center mt-3 note">
Veuillez ne pas faire la demande plusieurs fois.
</p>
</div>
</div>
</body>
</html>