1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-26 04:37:35 +02:00

Possibilité de supprimer un participant

This commit is contained in:
Yohann
2019-10-27 00:18:50 +02:00
parent faae8613cf
commit ac1b3ec7e8
2 changed files with 43 additions and 24 deletions

View File

@ -49,6 +49,16 @@ if (isset($_POST["view_as"]) && $_SESSION["role"] == Role::ADMIN) {
exit();
}
if (isset($_POST["delete_account"]) && $team == null && $_SESSION["role"] == Role::ADMIN) {
/** @var Document $document */
foreach ($user->getAllDocuments() as $document)
unlink($LOCAL_PATH . "/files/" . $document->getFileId());
$DB->prepare("DELETE FROM `documents` WHERE `user` = ?;")->execute([$user->getId()]);
$DB->prepare("DELETE FROM `users` WHERE `id` = ?;")->execute([$user->getId()]);
header("Location: /");
exit();
}
class AttributeTeam
{
private $team_id;