mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-30 15:21:17 +02:00
Ajout d'une classe pour les fichiers à télécharger, meilleur support des organisateurs d'un tournoi
This commit is contained in:
@ -3,19 +3,12 @@
|
||||
$tournament_name = htmlspecialchars($_GET["name"]);
|
||||
|
||||
$tournament = Tournament::fromName($tournament_name);
|
||||
$orgas = $tournament->getOrganizers();
|
||||
|
||||
if ($tournament === null)
|
||||
require_once "server_files/404.php";
|
||||
|
||||
$orgas_req = $DB->query("SELECT `users`.`id` AS `id` FROM `users` JOIN `organizers` ON `users`.`id` = `organizer` WHERE `tournament` = " . $tournament->getId() . ";");
|
||||
$orgas = [];
|
||||
$orgas_id = [];
|
||||
while (($orga_data = $orgas_req->fetch()) !== false) {
|
||||
$orgas[] = User::fromId($orga_data["id"]);
|
||||
$orgas_id[] = $orga_data["id"];
|
||||
}
|
||||
|
||||
if (isset($_GET["modifier"]) && $_SESSION["role"] != Role::ADMIN && !in_array($_SESSION["user_id"], $orgas_id))
|
||||
if (isset($_GET["modifier"]) && $_SESSION["role"] != Role::ADMIN && !$tournament->organize($_SESSION["user_id"]))
|
||||
require_once "server_files/403.php";
|
||||
|
||||
if (isset($_POST["edit_tournament"])) {
|
||||
|
Reference in New Issue
Block a user