2026-03-10 18:54:16 +00:00
|
|
|
<?php
|
2026-03-11 08:59:22 +00:00
|
|
|
include("./Assets/functions.php");
|
|
|
|
|
$config = json_decode(file_get_contents("./Assets/config.json"), true);
|
|
|
|
|
$bdd = connectBDD("localhost", $config["BDD_USER"], $config["BDD_PASSWD"], $config["BDD_NAME"]);
|
|
|
|
|
|
|
|
|
|
if (isset($_POST['password1'])) {
|
|
|
|
|
if ($_POST['password1'] == $_POST['password2']) {
|
|
|
|
|
$user = getUserFromCode($bdd, $_POST['code']);
|
|
|
|
|
updateUserPassword($bdd, $user, hash('sha256', $_POST['password1']));
|
|
|
|
|
header('location: index.php');
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-03-10 18:54:16 +00:00
|
|
|
?>
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="fr">
|
2026-03-11 08:59:22 +00:00
|
|
|
|
2026-03-10 18:54:16 +00:00
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
2026-03-11 08:59:22 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
|
|
|
|
|
<title>Créer mon mot de passe</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;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
2026-03-10 18:54:16 +00:00
|
|
|
</head>
|
2026-03-11 08:59:22 +00:00
|
|
|
|
|
|
|
|
<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">
|
|
|
|
|
Créer mon mot de passe
|
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
|
|
<form method="post">
|
|
|
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label for="password1" class="form-label">
|
|
|
|
|
Nouveau mot de passe
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="password"
|
|
|
|
|
class="form-control"
|
|
|
|
|
name="password1"
|
|
|
|
|
id="password1"
|
|
|
|
|
required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label for="password2" class="form-label">
|
|
|
|
|
Confirmer le mot de passe
|
|
|
|
|
</label>
|
|
|
|
|
<input
|
|
|
|
|
type="password"
|
|
|
|
|
class="form-control"
|
|
|
|
|
name="password2"
|
|
|
|
|
id="password2"
|
|
|
|
|
required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<input type="hidden" name="code" value="<?= htmlspecialchars($_GET['code']) ?>">
|
|
|
|
|
|
|
|
|
|
<div class="d-grid">
|
|
|
|
|
<button type="submit" class="btn btn-primary">
|
|
|
|
|
Créer mon mot de passe
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-10 18:54:16 +00:00
|
|
|
</body>
|
2026-03-11 08:59:22 +00:00
|
|
|
|
2026-03-10 18:54:16 +00:00
|
|
|
</html>
|