mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-25 12:17:23 +02:00
Phase 1 (en cours)
This commit is contained in:
38
server_files/controllers/envoyer_video.php
Normal file
38
server_files/controllers/envoyer_video.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/** @var Team $team */
|
||||
$team = $_SESSION["team"];
|
||||
|
||||
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::PARTICIPANT && $_SESSION["role"] != Role::ENCADRANT || $team == null || $team->getValidationStatus() != ValidationStatus::VALIDATED)
|
||||
require_once "server_files/403.php";
|
||||
|
||||
$has_error = false;
|
||||
$error_message = null;
|
||||
|
||||
if (isset($_POST["upload"])) {
|
||||
$new_video = new NewVideo($_POST);
|
||||
try {
|
||||
$new_video->makeVerfications();
|
||||
$new_video->uploadVideo();
|
||||
} catch (AssertionError $e) {
|
||||
$has_error = true;
|
||||
$error_message = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
class NewVideo
|
||||
{
|
||||
private $link;
|
||||
|
||||
public function __construct($data)
|
||||
{
|
||||
$this->link = $data["link"];
|
||||
}
|
||||
|
||||
public function makeVerifications()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
require_once "server_files/views/envoyer_video.php";
|
Reference in New Issue
Block a user