diff --git a/server_files/controllers/informations.php b/server_files/controllers/informations.php index c00e109..012a5e8 100644 --- a/server_files/controllers/informations.php +++ b/server_files/controllers/informations.php @@ -74,7 +74,8 @@ if (isset($_POST["delete_account"]) && $team == null && $_SESSION["role"] == Rol foreach ($user->getAllDocuments($team->getTournamentId()) 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()]); + $DB->prepare("DELETE FROM `organizers` WHERE `organizer` = ?;")->execute([$user->getId()]); + $DB->prepare("DELETE FROM `users` WHERE `id` = ?;")->execute([$user->getId()]); header("Location: /"); exit(); } diff --git a/server_files/views/informations.php b/server_files/views/informations.php index 7701f7b..800db2a 100644 --- a/server_files/views/informations.php +++ b/server_files/views/informations.php @@ -178,7 +178,15 @@ elseif (($user->getRole() == Role::PARTICIPANT || $user->getRole() == Role::ENCA } } -if ($_SESSION["role"] == Role::ADMIN) { ?> +if ($_SESSION["role"] == Role::ADMIN) { + if ($user->getRole() != Role::ADMIN && $team == null) { ?> +
+ +
+ +
+