Derniere version de site au 4/10/2026
This commit is contained in:
1 parent
21f34c64c9
commit
dbb8e299a0
35 files changed
+8697
-1242
No files matched your search
+40
-41
@@ -1,40 +1,39 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../includes/bootstrap_global.php';
|
||||
|
||||
|
||||
// Sécurité : accès autorisé uniquement après vérification du code
|
||||
if (! isset($_SESSION['reset_email'], $_SESSION['code_valide']) || ! $_SESSION['code_valide']) {
|
||||
header("Location: mdp_oublie.php");
|
||||
exit;
|
||||
header("Location: mdp_oublie.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$erreur = '';
|
||||
$success = '';
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$mdp1 = $_POST['mot_de_passe'] ?? '';
|
||||
$mdp2 = $_POST['confirm_mot_de_passe'] ?? '';
|
||||
$mdp1 = $_POST['mot_de_passe'] ?? '';
|
||||
$mdp2 = $_POST['confirm_mot_de_passe'] ?? '';
|
||||
|
||||
if (strlen($mdp1) < 8 || $mdp1 !== $mdp2) {
|
||||
$erreur = $translations['erreur_mdp_invalides'];
|
||||
} else {
|
||||
$hash = password_hash($mdp1, PASSWORD_DEFAULT);
|
||||
$stmt = $pdo->prepare("UPDATE compte SET mot_de_passe = :hash WHERE email = :email");
|
||||
$stmt->execute([
|
||||
'hash' => $hash,
|
||||
'email' => $_SESSION['reset_email'],
|
||||
]);
|
||||
if (strlen($mdp1) < 8 || $mdp1 !== $mdp2) {
|
||||
$erreur = $translations['erreur_mdp_invalides'];
|
||||
} else {
|
||||
$hash = password_hash($mdp1, PASSWORD_DEFAULT);
|
||||
$stmt = $pdo->prepare("UPDATE compte SET mot_de_passe = :hash WHERE email = :email");
|
||||
$stmt->execute([
|
||||
'hash' => $hash,
|
||||
'email' => $_SESSION['reset_email'],
|
||||
]);
|
||||
|
||||
// Nettoyage session
|
||||
$lang = $_SESSION['lang'] ?? 'ru';
|
||||
session_unset();
|
||||
session_destroy();
|
||||
session_start();
|
||||
$_SESSION['lang'] = $lang;
|
||||
// Nettoyage session
|
||||
$lang = $_SESSION['lang'] ?? 'ru';
|
||||
session_unset();
|
||||
session_destroy();
|
||||
session_start();
|
||||
$_SESSION['lang'] = $lang;
|
||||
|
||||
$success = $translations['success_mdp_mis_a_jour'];
|
||||
$success = $translations['success_mdp_mis_a_jour'];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -42,12 +41,12 @@
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><?= $translations['nouveau_mdp_title'] ?></title>
|
||||
<title><?php echo $translations['nouveau_mdp_title'] ?></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="<?= asset('/includes/site_style.css') ?>">
|
||||
<link rel="stylesheet" href="<?= asset('/includes/custom_style.css') ?>"> <!-- ta home -->
|
||||
<link rel="stylesheet" href="<?= asset('/includes/mobil_style.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo asset('/includes/site_style.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo asset('/includes/custom_style.css') ?>"> <!-- ta home -->
|
||||
<link rel="stylesheet" href="<?php echo asset('/includes/mobil_style.css') ?>">
|
||||
|
||||
<style>
|
||||
.strength-bar {
|
||||
@@ -94,7 +93,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<nav class="header-actions">
|
||||
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
@@ -102,17 +101,17 @@
|
||||
<div class="main">
|
||||
|
||||
<div class="card shadow-sm p-4" style="min-width: 380px; max-width: 480px; width: 100%;">
|
||||
<h3 class="mb-4 text-center"><?= $translations['nouveau_mdp_h3'] ?></h3>
|
||||
<h3 class="mb-4 text-center"><?php echo $translations['nouveau_mdp_h3'] ?></h3>
|
||||
|
||||
<?php if (!empty($erreur)): ?>
|
||||
<?php if (! empty($erreur)): ?>
|
||||
<div class="alert alert-danger py-2"><?php echo htmlspecialchars($erreur); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($success)): ?>
|
||||
<?php if (! empty($success)): ?>
|
||||
<div class="alert alert-primary py-2 text-center">
|
||||
<div><?= htmlspecialchars($success) ?></div>
|
||||
<div><?php echo htmlspecialchars($success) ?></div>
|
||||
</div>
|
||||
<a href="connexion.php" class="btn btn-danger fw-bold"><?= $translations['btn_se_connecter'] ?></a>
|
||||
<a href="connexion.php" class="btn btn-danger fw-bold"><?php echo $translations['btn_se_connecter'] ?></a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (empty($success)): ?>
|
||||
@@ -120,11 +119,11 @@
|
||||
|
||||
<!-- Nouveau mot de passe -->
|
||||
<div class="mb-3 field-wrapper">
|
||||
<input type="password" name="mot_de_passe" id="mot_de_passe" class="form-control" placeholder="<?= $translations['nouveau_mdp_placeholder'] ?>" required>
|
||||
<input type="password" name="mot_de_passe" id="mot_de_passe" class="form-control" placeholder="<?php echo $translations['nouveau_mdp_placeholder'] ?>" required>
|
||||
<span class="toggle-password" onclick="toggle('mot_de_passe')">👁️</span>
|
||||
</div>
|
||||
|
||||
<div id="niveau-securite" class="mb-2 text-muted"><?= $translations['mdp_regle_min'] ?></div>
|
||||
<div id="niveau-securite" class="mb-2 text-muted"><?php echo $translations['mdp_regle_min'] ?></div>
|
||||
|
||||
<div class="strength-bar mb-3">
|
||||
<div class="strength-fill"></div>
|
||||
@@ -134,21 +133,21 @@
|
||||
|
||||
<!-- Confirmation mot de passe -->
|
||||
<div class="mb-4 field-wrapper">
|
||||
<input type="password" name="confirm_mot_de_passe" id="confirm_mot_de_passe" class="form-control" placeholder="<?= $translations['confirm_mdp_placeholder'] ?>" required>
|
||||
<input type="password" name="confirm_mot_de_passe" id="confirm_mot_de_passe" class="form-control" placeholder="<?php echo $translations['confirm_mdp_placeholder'] ?>" required>
|
||||
<span class="toggle-password" onclick="toggle('confirm_mot_de_passe')">👁️</span>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary w-100"><?= $translations['btn_valider'] ?></button>
|
||||
<button type="submit" class="btn btn-primary w-100"><?php echo $translations['btn_valider'] ?></button>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const T = {
|
||||
rule: '<?= addslashes($translations['mdp_regle_min']) ?>',
|
||||
weak: '<?= addslashes($translations['securite_faible']) ?>',
|
||||
medium: '<?= addslashes($translations['securite_moyen']) ?>',
|
||||
strong: '<?= addslashes($translations['securite_fort']) ?>'
|
||||
rule: '<?php echo addslashes($translations['mdp_regle_min']) ?>',
|
||||
weak: '<?php echo addslashes($translations['securite_faible']) ?>',
|
||||
medium: '<?php echo addslashes($translations['securite_moyen']) ?>',
|
||||
strong: '<?php echo addslashes($translations['securite_fort']) ?>'
|
||||
};
|
||||
|
||||
function toggle(id) {
|
||||
@@ -196,7 +195,7 @@ document.getElementById('mot_de_passe').addEventListener('input', function () {
|
||||
</div>
|
||||
<footer class="site-footer">
|
||||
<div class="container">
|
||||
<p><?= $translations['copyr'] ?></p>
|
||||
<p><?php echo $translations['copyr'] ?></p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user