mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-07-06 12:54:01 +02:00
Corrections mineurs
This commit is contained in:
@ -33,7 +33,7 @@ if (isset($_POST["team_edit"])) {
|
||||
}
|
||||
|
||||
if (isset($_POST["request_validation"])) {
|
||||
if (!canValidate($team)) {
|
||||
if (!canValidate($_SESSION["team"])) {
|
||||
$has_error = true;
|
||||
$error_message = "Votre équipe ne peut pas demander la validation : il manque soit des participants, soit des documents.";
|
||||
}
|
||||
@ -73,12 +73,10 @@ if (isset($_GET["publish_videos"])) {
|
||||
class SendDocument
|
||||
{
|
||||
private $file;
|
||||
private $type;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->file = $_FILES["document"];
|
||||
$this->type = strtoupper(htmlspecialchars($_POST["type"]));
|
||||
}
|
||||
|
||||
public function makeVerifications()
|
||||
@ -102,9 +100,9 @@ class SendDocument
|
||||
if (!rename($this->file["tmp_name"], "$LOCAL_PATH/files/$id"))
|
||||
throw new AssertionError("Une erreur est survenue lors de l'envoi du fichier.");
|
||||
|
||||
$req = $DB->prepare("INSERT INTO `documents`(`file_id`, `user`, `team`, `problem`, `type`)
|
||||
VALUES (?, ?, ?, ?, ?);");
|
||||
$req->execute([$id, $_SESSION["user_id"], $_SESSION["team"]->getId(), $_SESSION["team"]->getProblem(), $this->type]);
|
||||
$req = $DB->prepare("INSERT INTO `documents`(`file_id`, `user`, `team`, `problem`)
|
||||
VALUES (?, ?, ?, ?);");
|
||||
$req->execute([$id, $_SESSION["user_id"], $_SESSION["team"]->getId(), $_SESSION["team"]->getProblem()]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user