diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index ac928a0..32ec0b7 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -41,31 +41,6 @@ class UserController extends AbstractController { } - #[Route('/', name: 'index', methods: ['GET'])] - public function index(): Response - { - $this->denyAccessUnlessGranted('ROLE_USER'); - - $user = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier()); - - if ($this->isGranted('ROLE_SUPER_ADMIN')) { - $uo = $this->uoRepository->findUsersWithOrganization(); - $noOrgUsers = $this->userService->formatNoOrgUsersAsAssoc( - $this->userRepository->findUsersWithoutOrganization()); - $usersByOrganization = $this->userService->groupByOrganization($uo); - $usersByOrganization += $noOrgUsers; - - //Log action - $this->actionService->createAction("View all users", $user, null, "All"); - - } else { - $usersByOrganization = []; - } - - return $this->render('user/index.html.twig', [ - 'usersByOrganization' => $usersByOrganization, - ]); - } #[Route('/view/{id}', name: 'show', methods: ['GET'])] public function view(int $id, Request $request): Response @@ -446,8 +421,8 @@ class UserController extends AbstractController ]); } - #[Route(path: '/indexTest', name: 'indexTest', methods: ['GET'])] - public function indexTest(): Response + #[Route(path: '/', name: 'index', methods: ['GET'])] + public function index(): Response { $actingUser = $this->userService->getUserByIdentifier($this->getUser()->getUserIdentifier()); if ($this->userService->hasAccessTo($actingUser, true) && $this->isGranted("ROLE_ADMIN")) { diff --git a/templates/user/index.html.twig b/templates/user/index.html.twig index c968b04..21b685f 100644 --- a/templates/user/index.html.twig +++ b/templates/user/index.html.twig @@ -3,35 +3,41 @@ {% block title %}User Profile{% endblock %} {% block body %} -
Vous n'avez pas les permissions nécessaires pour voir la liste des utilisateurs.
Vous n'avez pas les permissions nécessaires pour voir la liste des utilisateurs.
-