plateforme-corres2math/server_files/controllers/ma_participation.php

23 lines
685 B
PHP

<?php
if (isset($_SESSION["user_id"]) && isset($_SESSION["teams"]) && sizeof($_SESSION["teams"]) > 0) {
/**
* @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 ($user->getRole() == Role::ENCADRANT && $team->getEncadrantId() != $user->getId())
require_once "server_files/403.php";
$video = Video::getVideo(Reason::SOLUTION, $team);
$questions_received = Question::getQuestionsTo($team);
}
else
require_once "server_files/403.php";
require_once "server_files/views/ma_participation.php";