fix student qui a accès à toutes les listes

php
Anthony RICHARD 1 year ago
parent 8fe07e0328
commit 638b7e9aca

@ -22,7 +22,7 @@ class StudentController extends UserController
global $user; global $user;
$jeu = $_POST['jeu']; $jeu = $_POST['jeu'];
$model = new MdlStudent(); $model = new MdlStudent();
$voc = $model->getAll(); $voc = $model->getVocByGroup($user->getGroup());
echo $twig->render('vocabList.html', ['jeu' => $jeu, 'vocabularies' => $voc, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]); echo $twig->render('vocabList.html', ['jeu' => $jeu, 'vocabularies' => $voc, 'userID' => $user->getId(), 'userRole' => $user->getRoles()]);
} }

@ -19,6 +19,11 @@ class MdlStudent extends MdlUser
return $res; return $res;
} }
public function getVocByGroup(int $group): array{
$gtw = new VocabularyListGateway();
return $gtw->findByGroup($group);
}
public function is(string $login, array $roles): ?User public function is(string $login, array $roles): ?User
{ {
$gtw = new UserGateway(); $gtw = new UserGateway();

Loading…
Cancel
Save