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

Diffusion des vidéos

This commit is contained in:
galaxyoyo
2019-09-24 10:08:53 +02:00
parent 061e83fd58
commit 32e47f73f3
10 changed files with 56 additions and 26 deletions

View File

@ -58,6 +58,12 @@ if (isset($_SESSION["user_id"]) && isset($_SESSION["team"]) && $_SESSION["team"]
else
require_once "server_files/403.php";
if (isset($_GET["publish_videos"])) {
$team->setAllowPublish(!$team->allowPublish());
header("Location: /mon-equipe");
exit();
}
class SendDocument
{
private $file;
@ -115,13 +121,15 @@ class MyTeam
public function makeVerifications()
{
global $CONFIG;
ensure($this->name != "" && $this->name != null, "Veuillez spécifier un nom d'équipe.");
ensure($this->name == $this->team->getName() || !teamExists($this->name), "Une équipe existe déjà avec ce nom.");
ensure(preg_match("#^[\p{L} ]+$#ui", $this->name), "Le nom de l'équipe ne doit pas comporter de caractères spéciaux.");
ensure(preg_match("#^[A-Z]{3}$#", $this->trigram), "Le trigramme n'est pas valide.");
ensure($this->trigram == $this->team->getTrigram() || !trigramExists($this->trigram), "Une équipe a déjà choisi ce trigramme.");
ensure(preg_match("#^[1-4]$#", $this->problem), "Le problème indiqué n'existe pas.");
// ensure(date("y-m-d H:i:s") <= $this->tournament->getInscriptionDate(), "Les inscriptions sont terminées.");
ensure(date("Y-m-d H:i:s") <= $CONFIG->getInscriptionDate(), "Les inscriptions sont terminées.");
ensure($this->team->getValidationStatus() == ValidationStatus::NOT_READY, "Votre équipe est déjà validée ou en cours de validation.");
}