1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 16:57:26 +02:00

Usurpation d'identité

This commit is contained in:
Yohann D'ANELLO
2019-12-19 15:05:11 +01:00
parent 7db606e6eb
commit e9f10ca14f
4 changed files with 50 additions and 50 deletions

View File

@ -14,6 +14,14 @@ if ($_SESSION["role"] != Role::ORGANIZER && $_SESSION["role"] != Role::ADMIN) {
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();