1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-30 19:21:20 +02:00

First week fixes

This commit is contained in:
Yohann D'ANELLO
2020-05-05 01:06:57 +02:00
parent a064cc1817
commit 132481fda0
22 changed files with 541 additions and 59 deletions

View File

@ -34,12 +34,19 @@ if ($file !== null) {
$problem = $file->getProblem();
$name = "Problème $problem $trigram";
if (($_SESSION["role"] == Role::PARTICIPANT || $_SESSION["role"] == Role::ENCADRANT) && (!isset($_SESSION["team"]) || $_SESSION["team"]->getId() != $team->getId()))
require_once "server_files/403.php";
if (($_SESSION["role"] == Role::PARTICIPANT || $_SESSION["role"] == Role::ENCADRANT) && (!isset($_SESSION["team"]) || $_SESSION["team"]->getId() != $team->getId())) {
$req = $DB->prepare("SELECT opposed_problem, rapported_problem, opposed_problem_2, rapported_problem_2 FROM teams WHERE id = ?;");
$req->execute([$_SESSION["team"]->getId()]);
$data = $req->fetch();
if ($id != $data["opposed_problem"] && $id != $data["rapported_problem"]) {
if (date("Y-m-d H:i") < $tournament->getSolutionsDate2() || ($id != $data["opposed_problem_2"] && $id != $data["rapported_problem_2"]))
require_once "server_files/403.php";
}
}
}
else if ($type == DocumentType::SYNTHESIS) {
$dest = $file->getDest();
$name = "Note de synthèse $trigram pour " . ($dest == DestType::OPPOSANT ? "l'opposant" : "le rapporteur");
$name = "Note de synthèse $trigram " . ($dest == DestType::OPPOSANT ? "de l'opposant" : "du rapporteur");
if (($_SESSION["role"] == Role::PARTICIPANT || $_SESSION["role"] == Role::ENCADRANT) && (!isset($_SESSION["team"]) || $_SESSION["team"]->getId() != $team->getId()))
require_once "server_files/403.php";