1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2024-12-26 16:22:21 +00:00
plateforme-corres2math/server_files/controllers/equipe.php

32 lines
836 B
PHP
Raw Normal View History

<?php
//if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::ADMIN)
// require_once "server_files/403.php";
$trigram = htmlspecialchars($_GET["trigram"]);
$team = Team::fromTrigram($trigram);
if ($team === null)
require_once "server_files/404.php";
if (isset($_POST["validate"])) {
$team->setValidationStatus(ValidationStatus::VALIDATED);
}
if (isset($_POST["download_zip"])) {
$file_name = getZipFile($team->getProblem(), $team->getId());
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=\"Documents de l'équipe " . $team->getTrigram() . ".zip\"");
header("Content-Length: " . strval(filesize($file_name)));
readfile($file_name);
exit();
}
$documents = Document::getAllDocuments($team->getProblem(), $team->getId());
require_once "server_files/views/equipe.php";