feat: add CSS styling
This commit is contained in:
@@ -1,25 +1,35 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once __DIR__ . '/../controllers/controllerAdmin.php';
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
if (!isset($_SESSION["login"]) || !$_SESSION["is_admin"]) {
|
||||
header('Location: ../auth.php');
|
||||
exit;
|
||||
}
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Liste des utilisateurs</title>
|
||||
<link rel="stylesheet" href="../assets/css/style.css">
|
||||
</head>
|
||||
|
||||
// Récupérer les utilisateurs selon l'OU
|
||||
$users = listUsers();
|
||||
<body>
|
||||
<?php
|
||||
session_start();
|
||||
require_once __DIR__ . '/../controllers/controllerAdmin.php';
|
||||
|
||||
// Afficher le tableau des utilisateurs
|
||||
echo "<h1>Gestion des utilisateurs</h1>";
|
||||
if (!isset($_SESSION["login"]) || !$_SESSION["is_admin"]) {
|
||||
header('Location: ../auth.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_GET['ou'])) {
|
||||
echo "<h2>OU : " . htmlspecialchars(urldecode($_GET['ou'])) . "</h2>";
|
||||
}
|
||||
// Récupérer les utilisateurs selon l'OU
|
||||
$users = listUsers();
|
||||
|
||||
if (!empty($users)) {
|
||||
echo "<table border='1'>";
|
||||
echo "<tr>
|
||||
// Afficher le tableau des utilisateurs
|
||||
echo "<h1>Gestion des utilisateurs</h1>";
|
||||
|
||||
if (isset($_GET['ou'])) {
|
||||
echo "<h2>OU : " . htmlspecialchars(urldecode($_GET['ou'])) . "</h2>";
|
||||
}
|
||||
|
||||
if (!empty($users)) {
|
||||
echo "<table border='1'>";
|
||||
echo "<tr>
|
||||
<th>Nom</th>
|
||||
<th>Prénom</th>
|
||||
<th>Email</th>
|
||||
@@ -27,23 +37,23 @@ if (!empty($users)) {
|
||||
<th>Actions</th>
|
||||
</tr>";
|
||||
|
||||
foreach ($users as $entry) {
|
||||
if (!is_array($entry)) continue;
|
||||
foreach ($users as $entry) {
|
||||
if (!is_array($entry)) continue;
|
||||
|
||||
echo "<tr>
|
||||
echo "<tr>
|
||||
<td>" . ($entry['sn'][0] ?? '') . "</td>
|
||||
<td>" . ($entry['givenname'][0] ?? '') . "</td>
|
||||
<td>" . ($entry['mail'][0] ?? '') . "</td>
|
||||
<td>" . ($entry['distinguishedname'][0] ?? '') . "</td>
|
||||
<td>
|
||||
<a href='../views/edit_user.php?dn=" . urlencode($entry['distinguishedname'][0]) . "'>Modifier</a>
|
||||
<a href='../controllers/delete_user.php?dn=" . urlencode($entry['distinguishedname'][0]) . "' onclick='return confirm(\"Confirmer la suppression ?\")'>Supprimer</a>
|
||||
<td class='action-buttons'>
|
||||
<a href='../views/edit_user.php?dn=" . urlencode($entry['distinguishedname'][0]) . "' class='btn btn-edit'>Modifier</a>
|
||||
<a href='../controllers/delete_user.php?dn=" . urlencode($entry['distinguishedname'][0]) . "' class='btn btn-delete' onclick='return confirm(\"Confirmer la suppression ?\")'>Supprimer</a>
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
} else {
|
||||
echo "<p>Aucun utilisateur trouvé dans cette OU.</p>";
|
||||
}
|
||||
echo "</table>";
|
||||
} else {
|
||||
echo "<p>Aucun utilisateur trouvé dans cette OU.</p>";
|
||||
}
|
||||
|
||||
echo "<p><a href='../views/menu.php'>Retour au menu</a></p>";
|
||||
echo "<p><a href='../views/menu.php'>Retour au menu</a></p>";
|
||||
|
||||
Reference in New Issue
Block a user