mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-25 16:57:23 +02:00
Possibilité d'accéder à la vue d'une autre personne sur la plateforme en tant qu'administrateur
This commit is contained in:
@ -19,6 +19,15 @@ function loadUserValues()
|
||||
if ($user->getTeamId() !== null)
|
||||
$_SESSION["team"] = Team::fromId($user->getTeamId());
|
||||
}
|
||||
|
||||
if (isset($_GET["view-as-admin"])) {
|
||||
if (isset($_SESSION["admin"])) {
|
||||
$_SESSION["user_id"] = $_SESSION["admin"];
|
||||
unset($_SESSION["admin"]);
|
||||
}
|
||||
header("Location: /");
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
function quitTeam($user_id = -1)
|
||||
@ -277,17 +286,23 @@ function exportProblemsData() {
|
||||
|
||||
function displayVideo($link)
|
||||
{
|
||||
if (preg_match("#(https?\://|)(www\.|)youtube\.com\/watch\?v=(.*)#", $link, $matches)) {
|
||||
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";
|
||||
/** @noinspection HtmlDeprecatedAttribute */
|
||||
/** @noinspection HtmlDeprecatedTag */
|
||||
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";
|
||||
}
|
||||
elseif (preg_match("#(https?\://|)(www\.|)vimeo\.com/([0-9]*)#", $link, $matches)) {
|
||||
elseif (preg_match("#(https?://|)(www\.|)vimeo\.com/([0-9]*)#", $link, $matches)) {
|
||||
$code = $matches[3];
|
||||
echo "<center><iframe src=\"https://player.vimeo.com/video/$code?color=3be6c3\" width=\"853\" height=\"480\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>";
|
||||
/** @noinspection HtmlDeprecatedAttribute */
|
||||
/** @noinspection HtmlDeprecatedTag */
|
||||
echo "<center><iframe src=\"https://player.vimeo.com/video/$code?color=3be6c3\" width=\"853\" height=\"480\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen></iframe></center>";
|
||||
|
||||
}
|
||||
elseif (preg_match("#(https?\://|)(www\.|)dailymotion\.com/video/(.*)#", $link, $matches)) {
|
||||
elseif (preg_match("#(https?://|)(www\.|)dailymotion\.com/video/(.*)#", $link, $matches)) {
|
||||
$code = $matches[3];
|
||||
/** @noinspection HtmlDeprecatedAttribute */
|
||||
/** @noinspection HtmlDeprecatedTag */
|
||||
echo "<center><iframe frameborder=\"0\" width=\"853\" height=\"480\" src=\"https://www.dailymotion.com/embed/video/$code\" allowfullscreen allow=\"autoplay\"></iframe></center>";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user