1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 16:57:23 +02:00

Sans utilisateur, le premier inscrit est administrateur

This commit is contained in:
galaxyoyo
2019-09-24 11:00:44 +02:00
parent 6f9fddd7a8
commit e878854861
3 changed files with 14 additions and 4 deletions

View File

@ -9,6 +9,11 @@ function loadUserValues()
if (isset($_SESSION["user_id"])) {
$user = $_SESSION["user"] = User::fromId($_SESSION["user_id"]);
if ($user == null) {
unset($_SESSION["user_id"]);
return;
}
$_SESSION["role"] = $user->getRole();
if ($user->getTeamId() !== null)