From a455edf350a10770ffa6b220d307152480f0df47 Mon Sep 17 00:00:00 2001 From: Whykioh Date: Thu, 19 Mar 2026 13:28:34 +0100 Subject: [PATCH] sdvfgvhbn --- poker-paf/Js/Index.js | 28 ------------------- poker-paf/admin-login.html | 56 ++++++++++++++++++++++++++++---------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/poker-paf/Js/Index.js b/poker-paf/Js/Index.js index 23c8d2f..edeae15 100644 --- a/poker-paf/Js/Index.js +++ b/poker-paf/Js/Index.js @@ -1,5 +1,4 @@ -const hashedAdminPassword = "7215d31f702fe2faf2a7df114c6427007bd254740c6b9cbaa2a5505060088929"; async function SqlRequest(action, params = {}) { try { @@ -89,31 +88,4 @@ async function joinGameAsAdmin(gameId) { window.location.href = `admin-login.html?game_id=${gameId}`; } -// Récupérer le formulaire de admin-login -const adminLoginForm = document.getElementById('admin-login-form'); - -adminLoginForm.addEventListener('submit', async function(event) { - event.preventDefault(); - // Désactiver le bouton pour éviter les soumissions multiples - const password = this.querySelector('input[type="password"]').value; - const urlParams = new URLSearchParams(window.location.search); - const gameId = urlParams.get('game_id'); - // Vérification du mot de passe - const hashedInputPassword = CryptoJS.SHA256(password).toString(); - - if (hashedInputPassword !== hashedAdminPassword) { - alert("Mot de passe incorrect. Veuillez réessayer."); - return; - } - - // Requete SQL pour définir l'utilisateur comme admin du jeu - const response = await SqlRequest('adminLogin', {game_id: gameId}); - - if (response.success) { - window.location.href = `admin-game.html?game_id=${gameId}`; // Redirige vers la page d'administration du jeu - } else { - alert("Erreur lors de la connexion. Veuillez réessayer."); // Affiche une alerte en cas d'erreur - } -}); - diff --git a/poker-paf/admin-login.html b/poker-paf/admin-login.html index 1490fc2..1621395 100644 --- a/poker-paf/admin-login.html +++ b/poker-paf/admin-login.html @@ -1,16 +1,44 @@ - - Connexion Administrateur - PokerPaf - - - -

Admin Login

-
- - -

- -
- - + + Connexion Administrateur - PokerPaf + + + +

Admin Login

+
+ + +

+ +
+ + \ No newline at end of file