From 090f0c00259e9e3848300fad56e5cb56a8bcfae5 Mon Sep 17 00:00:00 2001 From: "anthony.richard" Date: Mon, 20 Nov 2023 16:08:40 +0100 Subject: [PATCH] front avec userID --- Project/php/controller/FrontController.php | 2 +- Project/php/templates/quizContainer.twig | 61 ---------------------- 2 files changed, 1 insertion(+), 62 deletions(-) delete mode 100755 Project/php/templates/quizContainer.twig diff --git a/Project/php/controller/FrontController.php b/Project/php/controller/FrontController.php index cd24ccb..5c31005 100755 --- a/Project/php/controller/FrontController.php +++ b/Project/php/controller/FrontController.php @@ -50,7 +50,6 @@ class FrontController break; default : - if ($id != null && !$this->checkIdExist($id)) throw new Exception("identifiant invalide"); if ($target == null) throw new Exception("pas de target"); if (isset($_SESSION['login']) && isset($_SESSION['roles'])) { @@ -62,6 +61,7 @@ class FrontController $mdl = new $mdl; if (is_callable(array($mdl, 'is'))) { + global $user; $user = call_user_func_array(array($mdl, 'is'), array($_SESSION['login'], $_SESSION['roles'])); if (!$user || $user->getId() != $id) throw new Exception("erreur 403 permission denied"); diff --git a/Project/php/templates/quizContainer.twig b/Project/php/templates/quizContainer.twig deleted file mode 100755 index 8a9d371..0000000 --- a/Project/php/templates/quizContainer.twig +++ /dev/null @@ -1,61 +0,0 @@ - - - - {% if translations is defined %} - {% for row in translations %} - - - - - - - - - - - Manage groups - - - -
-

Quiz

-
- {% if translations is defined %} - {% for translation in translations %} -

{{ translation.word1 }}

- {% set answers = [translation.word2] %} - {% for i in 0..3 %} - {{ answers[i] }}
- {% endfor %} - {% endfor %} - {% endif %} - - - -

Translator

-
- {% if translations is defined %} -
{{ row.id }}{{ row.word1 }}{{ row.word2 }}{{ row.listVocab }}
- - - - - - - {% for translation in translations %} - - - - - - - {% endfor %} -
IDWord 1Word 2List Vocabulary
{{ translation.id }}{{ translation.word1 }}{{ translation.word2 }}{{ translation.listVocab }}
- {% endif %} - - - - - - - \ No newline at end of file