2019-09-06 11:48:50 +00:00
|
|
|
<?php
|
|
|
|
|
2019-09-06 23:33:05 +00:00
|
|
|
if (!isset($_SESSION["role"]))
|
2019-09-07 11:42:36 +00:00
|
|
|
require_once "server_files/403.php";
|
2019-09-06 11:48:50 +00:00
|
|
|
|
|
|
|
$id = $_GET["id"];
|
2019-09-06 23:33:05 +00:00
|
|
|
$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()))
|
2019-09-07 11:42:36 +00:00
|
|
|
require_once "server_files/403.php";
|
2019-09-06 23:33:05 +00:00
|
|
|
}
|
2019-09-06 11:48:50 +00:00
|
|
|
|
2019-09-07 23:35:05 +00:00
|
|
|
if ($user === null)
|
2019-09-07 11:42:36 +00:00
|
|
|
require_once "server_files/404.php";
|
2019-09-06 11:48:50 +00:00
|
|
|
|
2019-12-19 14:05:11 +00:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2019-09-06 23:33:05 +00:00
|
|
|
$team = Team::fromId($user->getTeamId());
|
2019-09-07 23:35:05 +00:00
|
|
|
$tournaments = $user->getOrganizedTournaments();
|
2019-09-06 11:48:50 +00:00
|
|
|
|
2019-09-07 23:35:05 +00:00
|
|
|
if ($team != null) {
|
|
|
|
$documents = $user->getAllDocuments($team->getTournamentId());
|
|
|
|
if ($team->isSelectedForFinal())
|
|
|
|
$documents_final = $user->getAllDocuments($FINAL->getId());
|
|
|
|
}
|
2019-09-06 11:48:50 +00:00
|
|
|
|
2019-09-07 11:42:36 +00:00
|
|
|
require_once "server_files/views/informations.php";
|