mirror of
https://github.com/ZeJMaN/LBCAlerte_ynh.git
synced 2025-07-06 20:00:48 +02:00
Initial commit
Functional, without SSO
This commit is contained in:
15
sources/app/admin/scripts/delete-user.php
Normal file
15
sources/app/admin/scripts/delete-user.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_GET["username"]) || !$user = $userStorage->fetchByUsername($_GET["username"])) {
|
||||
header("LOCATION: ?mod=admin&a=users");
|
||||
exit;
|
||||
}
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$userStorage->delete($user);
|
||||
$configAlert = DOCUMENT_ROOT."/var/configs/".$user->getUsername().".csv";
|
||||
if (is_file($configAlert)) {
|
||||
unlink($configAlert);
|
||||
}
|
||||
header("LOCATION: ?mod=admin&a=users");
|
||||
exit;
|
||||
}
|
Reference in New Issue
Block a user