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

Possibilité d'encadrer plusieurs équipes

This commit is contained in:
Yohann
2019-12-04 11:45:14 +01:00
parent 8fa1183f9f
commit 95d7f30536
20 changed files with 185 additions and 42 deletions

View File

@ -1,9 +1,19 @@
<?php
/** @var Team $team */
$team = $_SESSION["team"];
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::PARTICIPANT && $_SESSION["role"] != Role::ENCADRANT || Phase::getCurrentPhase() != Phase::PHASE4)
require_once "server_files/403.php";
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::PARTICIPANT && $_SESSION["role"] != Role::ENCADRANT || $team == null || Phase::getCurrentPhase() != Phase::PHASE4)
/**
* @var User $user
* @var Team $team
*/
$user = $_SESSION["user"];
$team = $user->getRole() == Role::PARTICIPANT ? $_SESSION["team"] : Team::fromTrigram($_GET["trigram"]);
if ($team == null)
require_once "server_files/404.php";
if ($team->getEncadrantId() != $user->getId() || $team->getValidationStatus() != ValidationStatus::VALIDATED)
require_once "server_files/403.php";
if (isset($_POST["upload_answer"])) {