mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-05 01:26:54 +00:00
Phase 1 : affichage des vidéos pour les admins
This commit is contained in:
parent
a8db4a421c
commit
1e67b8569d
@ -30,9 +30,9 @@ $ROUTES["^(|accueil|index|accueil\.php|accueil\.html|accueil\.py|index\.php|inde
|
||||
$ROUTES["^ajouter_equipe$"] = ["server_files/controllers/ajouter_equipe.php"];
|
||||
$ROUTES["^ajouter_admin$"] = ["server_files/controllers/ajouter_admin.php"];
|
||||
$ROUTES["^calendrier$"] = ["server_files/controllers/calendrier.php"];
|
||||
$ROUTES["^confirmer_mail/([a-z0-9]*)/?$"] = ["server_files/controllers/confirmer_mail.php", "token"];
|
||||
$ROUTES["^confirmer-mail/([a-z0-9]*)/?$"] = ["server_files/controllers/confirmer_mail.php", "token"];
|
||||
$ROUTES["^connexion/(confirmation-mail)/?$"] = ["server_files/controllers/connexion.php", "confirmation-mail"];
|
||||
$ROUTES["^connexion/(mdp_oublie)/?$"] = ["server_files/controllers/connexion.php", "mdp_oublie"];
|
||||
$ROUTES["^connexion/(mdp-oublie)/?$"] = ["server_files/controllers/connexion.php", "mdp_oublie"];
|
||||
$ROUTES["^connexion/(reinitialiser_mdp)/(.*)/?$"] = ["server_files/controllers/connexion.php", "reset_password", "token"];
|
||||
$ROUTES["^connexion/?$"] = ["server_files/controllers/connexion.php"];
|
||||
$ROUTES["^deconnexion/?$"] = ["server_files/controllers/deconnexion.php"];
|
||||
@ -41,12 +41,13 @@ $ROUTES["^equipe/([A-Z]{3})/?$"] = ["server_files/controllers/equipe.php", "trig
|
||||
$ROUTES["^file/([a-z0-9]{64})/?$"] = ["server_files/controllers/view_file.php", "file_id"];
|
||||
$ROUTES["^informations/([0-9]*)/.*?$"] = ["server_files/controllers/informations.php", "id"];
|
||||
$ROUTES["^inscription/?$"] = ["server_files/controllers/inscription.php"];
|
||||
$ROUTES["^mon_compte/?$"] = ["server_files/controllers/mon_compte.php"];
|
||||
$ROUTES["^mon_equipe/(modifier)/?$"] = ["server_files/controllers/mon_equipe.php", "modifier"];
|
||||
$ROUTES["^mon_equipe/?$"] = ["server_files/controllers/mon_equipe.php"];
|
||||
$ROUTES["^mon-compte/?$"] = ["server_files/controllers/mon_compte.php"];
|
||||
$ROUTES["^mon-equipe/(modifier)/?$"] = ["server_files/controllers/mon_equipe.php", "modifier"];
|
||||
$ROUTES["^mon-equipe/?$"] = ["server_files/controllers/mon_equipe.php"];
|
||||
$ROUTES["^probleme/([1-4])/?$"] = ["server_files/controllers/probleme.php", "probleme"];
|
||||
$ROUTES["^problemes/?$"] = ["server_files/controllers/problemes.php"];
|
||||
$ROUTES["^rejoindre_equipe/?$"] = ["server_files/controllers/rejoindre_equipe.php"];
|
||||
$ROUTES["^videos-solutions/?$"] = ["server_files/controllers/videos_solutions.php"];
|
||||
|
||||
# Assets files
|
||||
|
||||
|
@ -127,7 +127,7 @@ class MyTeam
|
||||
$this->team->setTrigram($this->trigram);
|
||||
$this->team->setProblem($this->problem);
|
||||
|
||||
header("Location: $URL_BASE/mon_equipe");
|
||||
header("Location: $URL_BASE/mon-equipe");
|
||||
}
|
||||
}
|
||||
|
||||
|
11
server_files/controllers/videos_solutions.php
Normal file
11
server_files/controllers/videos_solutions.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (!isset($_SESSION["user_id"]) || $_SESSION["role"] != Role::ADMIN)
|
||||
require_once "server_files/403.php";
|
||||
|
||||
$videos = [];
|
||||
|
||||
for ($problem = 1; $problem <= 4; ++$problem)
|
||||
$videos[] = Video::getVideos(Reason::SOLUTION, $problem);
|
||||
|
||||
require_once "server_files/views/videos_solutions.php";
|
@ -9,7 +9,7 @@
|
||||
Bonjour {FIRST_NAME} {SURNAME},<br/>
|
||||
<br/>
|
||||
Vous venez de changer votre adresse e-mail. Veuillez désormais la confirmer en cliquant ici : <a
|
||||
href="{URL_BASE}/confirmer_mail/{TOKEN}">{URL_BASE}/confirmer_mail/{TOKEN}</a><br/>
|
||||
href="{URL_BASE}/confirmer-mail/{TOKEN}">{URL_BASE}/confirmer-mail/{TOKEN}</a><br/>
|
||||
<br/>
|
||||
Le comité d'organisation des Correspondances des Jeunes Mathématicien·ne·s
|
||||
</body>
|
||||
|
@ -9,7 +9,7 @@
|
||||
Bonjour {FIRST_NAME} {SURNAME},<br/>
|
||||
<br/>
|
||||
Vous êtes inscrit aux Correspondances des Jeunes Mathématicien·ne·s {YEAR} et nous vous en remercions.<br/>
|
||||
Pour valider votre adresse e-mail, veuillez cliquer sur le lien : <a href="{URL_BASE}/confirmer_mail/{TOKEN}">{URL_BASE}/confirmer_mail/{TOKEN}</a><br/>
|
||||
Pour valider votre adresse e-mail, veuillez cliquer sur le lien : <a href="{URL_BASE}/confirmer-mail/{TOKEN}">{URL_BASE}/confirmer-mail/{TOKEN}</a><br/>
|
||||
<br/>
|
||||
Cordialement,<br/>
|
||||
<br/>
|
||||
|
@ -9,7 +9,7 @@
|
||||
Bonjour {FIRST_NAME} {SURNAME},<br />
|
||||
<br />
|
||||
Vous venez de vous inscrire aux Correspondances des Jeunes Mathématicien·ne·s {YEAR} et nous vous en remercions.<br />
|
||||
Pour valider votre adresse e-mail, veuillez cliquer sur le lien : <a href="{URL_BASE}/confirmer_mail/{TOKEN}">{URL_BASE}/confirmer_mail/{TOKEN}</a><br />
|
||||
Pour valider votre adresse e-mail, veuillez cliquer sur le lien : <a href="{URL_BASE}/confirmer-mail/{TOKEN}">{URL_BASE}/confirmer-mail/{TOKEN}</a><br />
|
||||
<br />
|
||||
Le comité d'organisation des Correspondances des Jeunes Mathématicien·ne·s
|
||||
</body>
|
||||
|
@ -18,7 +18,7 @@ else {
|
||||
require_once "footer.php";
|
||||
}
|
||||
}
|
||||
if (isset($_GET["mdp_oublie"])) { ?>
|
||||
if (isset($_GET["mdp-oublie"])) { ?>
|
||||
<form method="POST">
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
@ -87,7 +87,7 @@ if (isset($_GET["mdp_oublie"])) { ?>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<!--suppress HtmlUnknownTarget -->
|
||||
<a href="<?= $URL_BASE ?>/connexion/mdp_oublie">Mot de passe oublié ?</a>
|
||||
<a href="<?= $URL_BASE ?>/connexion/mdp-oublie">Mot de passe oublié ?</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -11,10 +11,10 @@ elseif (isset($new_video))
|
||||
<?php
|
||||
if ($video !== null) {
|
||||
$link = $video->getLink();
|
||||
echo "Lien de la vidéo déjà envoyée : <a href=\"$link\">$link</a> (version " . $video->getVersion() . ")<br />";
|
||||
echo "Lien de la vidéo déjà envoyée : <a href=\"$link\">$link</a> (version " . $video->getVersion() . ")<br />\n";
|
||||
if (preg_match("#(https?\://|)(www\.|)youtube\.com\/watch\?v=(.*)#", $link, $matches)) {
|
||||
$code = $matches[3];
|
||||
echo "<center><iframe width=\"854px\" height=\"480px\" src=\"https://www.youtube.com/embed/$code\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></center><br />";
|
||||
echo "<center><iframe width=\"854px\" height=\"480px\" src=\"https://www.youtube.com/embed/$code\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></center><br />\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -32,7 +32,7 @@
|
||||
<li><a href="<?= $URL_BASE ?>/inscription">Inscription</a></li>
|
||||
<?php }
|
||||
} else { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/mon_compte">Mon compte</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/mon-compte">Mon compte</a></li>
|
||||
<?php if ($_SESSION["role"] == Role::ENCADRANT || $_SESSION["role"] == Role::PARTICIPANT) { ?>
|
||||
<?php if ($_SESSION["team"] == NULL) {
|
||||
if (date("Y-m-d H:i:s") < $CONFIG->getInscriptionDate()) { ?>
|
||||
@ -40,7 +40,7 @@
|
||||
<li><a href="<?= $URL_BASE ?>/rejoindre_equipe">Rejoindre une équipe</a></li>
|
||||
<?php }
|
||||
} else { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/mon_equipe">Mon équipe</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/mon-equipe">Mon équipe</a></li>
|
||||
<?php if ($_SESSION["team"]->getValidationStatus() == ValidationStatus::VALIDATED) {
|
||||
switch (Phase::getCurrentPhase()) {
|
||||
case Phase::PHASE1: ?>
|
||||
@ -52,6 +52,7 @@
|
||||
<?php } ?>
|
||||
<?php if ($_SESSION["role"] == Role::ADMIN) { ?>
|
||||
<li><a href="<?= $URL_BASE ?>/ajouter_admin">Ajouter un administrateur</a></li>
|
||||
<li><a href="<?= $URL_BASE ?>/videos-solutions">Vidéos des solutions</a></li>
|
||||
<?php } ?>
|
||||
<li><a href="<?= $URL_BASE ?>/deconnexion">Déconnexion</a></li>
|
||||
<hr/>
|
||||
|
@ -81,7 +81,7 @@ for ($i = 1; $i <= 5; ++$i) {
|
||||
|
||||
<?php if ($_SESSION["team_validation_status"] == ValidationStatus::NOT_READY) { ?>
|
||||
<!--suppress HtmlUnknownTarget -->
|
||||
<a href="<?= $URL_BASE ?>/mon_equipe/modifier">Modifier mon équipe</a>
|
||||
<a href="<?= $URL_BASE ?>/mon-equipe/modifier">Modifier mon équipe</a>
|
||||
<?php } ?>
|
||||
<hr/>
|
||||
<h2>Autorisation de droit à l'image</h2>
|
||||
|
21
server_files/views/videos_solutions.php
Normal file
21
server_files/views/videos_solutions.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
require_once "header.php";
|
||||
|
||||
for ($problem = 1; $problem <= 4; ++$problem) {
|
||||
echo "<h2>Vidéos pour le problème $problem</h2>\n";
|
||||
/** @var Video $video */
|
||||
foreach ($videos[$problem - 1] as $video) {
|
||||
$link = $video->getLink();
|
||||
$team = Team::fromId($video->getTeam());
|
||||
$version = $video->getVersion();
|
||||
echo "Vidéo de présentation de l'équipe « " . $team->getName() . " » (" . $team->getTrigram() . "), version $version : <a href=\"$link\">$link</a>\n";
|
||||
if (preg_match("#(https?\://|)(www\.|)youtube\.com\/watch\?v=(.*)#", $link, $matches)) {
|
||||
$code = $matches[3];
|
||||
echo "<center><iframe width=\"854px\" height=\"480px\" src=\"https://www.youtube.com/embed/$code\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe></center><br />\n";
|
||||
}
|
||||
}
|
||||
echo "<hr />\n";
|
||||
}
|
||||
|
||||
require_once "footer.php";
|
Loading…
Reference in New Issue
Block a user