Suppression de la possibilité de changer de rôle facilement

This commit is contained in:
galaxyoyo 2019-09-24 00:13:37 +02:00
parent 22c90369e8
commit 649a66b2f1
2 changed files with 0 additions and 30 deletions

View File

@ -13,24 +13,6 @@ function loadUserValues()
if ($user->getTeamId() !== null) if ($user->getTeamId() !== null)
$_SESSION["team"] = Team::fromId($user->getTeamId()); $_SESSION["team"] = Team::fromId($user->getTeamId());
if (isset($_GET["be-admin"])) {
quitTeam();
$user->setRole(Role::ADMIN);
exit();
}
if (isset($_GET["be-participant"])) {
quitTeam();
$user->setRole(Role::PARTICIPANT);
exit();
}
if (isset($_GET["be-encadrant"])) {
quitTeam();
$user->setRole(Role::ENCADRANT);
exit();
}
} }
} }

View File

@ -78,18 +78,6 @@
<li><a href="<?= $URL_BASE ?>/videos-solutions">Vidéos des solutions</a></li> <li><a href="<?= $URL_BASE ?>/videos-solutions">Vidéos des solutions</a></li>
<?php } ?> <?php } ?>
<li><a href="<?= $URL_BASE ?>/deconnexion">Déconnexion</a></li> <li><a href="<?= $URL_BASE ?>/deconnexion">Déconnexion</a></li>
<hr/>
<?php
if ($_SESSION["role"] != Role::ADMIN) {
echo "<li><a href=\"?be-admin=1\">Devenir administrateur</a></li>\n";
}
if ($_SESSION["role"] != Role::PARTICIPANT) {
echo "<li><a href=\"?be-participant=1\">Devenir participant</a></li>\n";
}
if ($_SESSION["role"] != Role::ENCADRANT) {
echo "<li><a href=\"?be-encadrant=1\">Devenir encadrant</a></li>\n";
}
?>
<?php } ?> <?php } ?>
</ul> </ul>