From 1702c389a9ddeb4ff3bc1cc5e54afb668c9ad49f Mon Sep 17 00:00:00 2001 From: leosw Date: Sat, 27 Dec 2025 20:26:49 +0100 Subject: [PATCH] Admin delete user --- index.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 02cc717..0af56e5 100644 --- a/index.php +++ b/index.php @@ -481,6 +481,7 @@ if (!empty($_GET['deleted'])) { ID Nom Email + @@ -489,7 +490,7 @@ if (!empty($_GET['deleted'])) { - Supprimer + Supprimer @@ -507,12 +508,12 @@ if (!empty($_GET['deleted'])) { if ($action === 'delete_user' && isset($_SESSION['owner_id']) && $_SESSION['owner_id'] == 1) { $id = intval($_GET['id'] ?? 0); - if ($id > 0) { - $stmt = $pdo->prepare("DELETE FROM users WHERE id = ?"); + if ($id > 1) { + $stmt = $db->prepare("DELETE FROM owners WHERE id = ?"); $stmt->execute([$id]); } - header("Location: index.php?action=list_users&deleted=1"); + header("Location: index.php?action=admin&deleted=1"); exit; }