1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-21 05:18:26 +02:00

Utilisation d'un dispatcher pour gérer les redirections

This commit is contained in:
galaxyoyo
2019-09-07 13:42:36 +02:00
parent ae648d7615
commit 4d3f6d1847
45 changed files with 246 additions and 190 deletions

View File

@ -1,13 +1,11 @@
<?php
require_once "../config.php";
$tournament_name = htmlspecialchars($_GET["nom"]);
$tournament_name = htmlspecialchars($_GET["name"]);
$tournament = Tournament::fromName($tournament_name);
if ($tournament === null)
require_once "../404.php";
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 = [];
@ -18,7 +16,7 @@ while (($orga_data = $orgas_req->fetch()) !== false) {
}
if (isset($_GET["modifier"]) && $_SESSION["role"] != Role::ADMIN && !in_array($_SESSION["user_id"], $orgas_id))
require_once "../403.php";
require_once "server_files/403.php";
if (isset($_POST["edit_tournament"])) {
$error_message = updateTournament();
@ -123,6 +121,4 @@ function updateTournament() {
exit();
}
require_once "../views/header.php";
require_once "../views/tournoi.php";
require_once "../views/footer.php";
require_once "server_files/views/tournoi.php";