1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-26 07:17:36 +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

@ -22,6 +22,7 @@ class NewTeam {
public $name;
public $trigram;
public $problem;
public $allow_publish;
public $access_code;
public function __construct($data)
@ -30,6 +31,8 @@ class NewTeam {
$this->$key = htmlspecialchars($value);
$this->trigram = strtoupper($this->trigram);
$this->allow_publish = $this->allow_publish == "on";
}
public function makeVerifications() {
@ -50,10 +53,10 @@ class NewTeam {
$this->access_code = genRandomPhrase(6);
$req = $DB->prepare("INSERT INTO `teams` (`name`, `trigram`, `problem`, `encadrant`, `participant_1`, `validation_status`, `access_code`, `year`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?);");
$req = $DB->prepare("INSERT INTO `teams` (`name`, `trigram`, `problem`, `encadrant`, `participant_1`, `allow_publish`, `validation_status`, `access_code`, `year`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);");
$req->execute([$this->name, $this->trigram, $this->problem, $_SESSION["role"] == Role::ENCADRANT ? $_SESSION["user_id"] : NULL,
$_SESSION["role"] == Role::PARTICIPANT ? $_SESSION["user_id"] : NULL, ValidationStatus::getName(ValidationStatus::NOT_READY), $this->access_code, $YEAR]);
$_SESSION["role"] == Role::PARTICIPANT ? $_SESSION["user_id"] : NULL, $this->allow_publish, ValidationStatus::getName(ValidationStatus::NOT_READY), $this->access_code, $YEAR]);
$_SESSION["team"] = Team::fromTrigram($this->trigram);
$_SESSION["user"]->setTeamId($_SESSION["team"]->getId());