mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-26 16:22:23 +00:00
35 lines
988 B
PHP
35 lines
988 B
PHP
<?php
|
|
|
|
if (!isset($_SESSION["role"]))
|
|
require_once "server_files/403.php";
|
|
|
|
$id = $_GET["id"];
|
|
$user = User::fromId($id);
|
|
|
|
if ($_SESSION["role"] != Role::ORGANIZER && $_SESSION["role"] != Role::ADMIN) {
|
|
if ($user->getId() != $_SESSION["user_id"] && ($user->getTeamId() == null || $user->getTeamId() != $_SESSION["user"]->getTeamId()))
|
|
require_once "server_files/403.php";
|
|
}
|
|
|
|
if ($user === null)
|
|
require_once "server_files/404.php";
|
|
|
|
if (isset($_POST["view_as"]) && $_SESSION["role"] == Role::ADMIN) {
|
|
if (!isset($_SESSION["admin"]))
|
|
$_SESSION["admin"] = $_SESSION["user_id"];
|
|
$_SESSION["user_id"] = $user->getId();
|
|
header("Location: /");
|
|
exit();
|
|
}
|
|
|
|
$team = Team::fromId($user->getTeamId());
|
|
$tournaments = $user->getOrganizedTournaments();
|
|
|
|
if ($team != null) {
|
|
$documents = $user->getAllDocuments($team->getTournamentId());
|
|
if ($team->isSelectedForFinal())
|
|
$documents_final = $user->getAllDocuments($FINAL->getId());
|
|
}
|
|
|
|
require_once "server_files/views/informations.php";
|