feat: implement user creation, editing, and deletion functionality ALL features are working
This commit is contained in:
46
views/create_user.php
Normal file
46
views/create_user.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
session_start();
|
||||
if (!isset($_SESSION["login"]) || !$_SESSION["is_admin"]) {
|
||||
header('Location: auth.php');
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Créer un utilisateur</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Créer un nouvel utilisateur</h1>
|
||||
<form action="../controllers/create_user.php" method="post">
|
||||
<label for="ou_dn">OU cible :</label>
|
||||
<select id="ou_dn" name="ou_dn" required>
|
||||
<?php foreach ($_SESSION['admin_ous'] as $ou) : ?>
|
||||
<option value="<?= htmlspecialchars($ou) ?>"><?= htmlspecialchars($ou) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select><br><br>
|
||||
|
||||
<label for="username">Nom d'utilisateur :</label>
|
||||
<input type="text" id="username" name="username" required><br><br>
|
||||
|
||||
<label for="firstname">Prénom :</label>
|
||||
<input type="text" id="firstname" name="firstname" required><br><br>
|
||||
|
||||
<label for="lastname">Nom :</label>
|
||||
<input type="text" id="lastname" name="lastname" required><br><br>
|
||||
|
||||
<label for="email">E-mail :</label>
|
||||
<input type="email" id="email" name="email" required><br><br>
|
||||
|
||||
<label for="password">Mot de passe :</label>
|
||||
<input type="password" id="password" name="password" required><br><br>
|
||||
|
||||
<button type="submit">Créer l'utilisateur</button>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user