46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?php
|
|
session_start();
|
|
if (!isset($_SESSION["login"]) || !$_SESSION["is_admin"]) {
|
|
header('Location: auth.php');
|
|
exit;
|
|
}
|
|
|
|
require_once __DIR__ . '/../models/LDAPAuth.php';
|
|
$ldapAuth = new LDAPAuth();
|
|
|
|
// Récupérer les détails de l'utilisateur à modifier
|
|
$user_dn = urldecode($_GET['dn']);
|
|
$user_details = $ldapAuth->getUserDetailsByDn($user_dn);
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Modifier un utilisateur</title>
|
|
<link rel="stylesheet" href="../assets/css/style.css">
|
|
</head>
|
|
|
|
<body>
|
|
<h1>Modifier l'utilisateur</h1>
|
|
<form action="../controllers/edit_user.php" method="post">
|
|
<input type="hidden" name="dn" value="<?= htmlspecialchars($user_dn) ?>">
|
|
|
|
<label for="lastname">Nom :</label>
|
|
<input type="text" id="lastname" name="lastname" value="<?= htmlspecialchars($user_details['sn'] ?? '') ?>">
|
|
|
|
<label for="firstname">Prénom :</label>
|
|
<input type="text" id="firstname" name="firstname" value="<?= htmlspecialchars($user_details['givenname'] ?? '') ?>">
|
|
|
|
<label for="email">E-mail :</label>
|
|
<input type="email" id="email" name="email" value="<?= htmlspecialchars($user_details['mail'] ?? '') ?>">
|
|
|
|
<label for="new_password">Nouveau mot de passe :</label>
|
|
<input type="password" id="new_password" name="new_password">
|
|
|
|
<button type="submit">Modifier l'utilisateur</button>
|
|
</form>
|
|
</body>
|
|
|
|
</html>
|