profile done

This commit is contained in:
Olivier PARPAILLON
2024-11-25 11:00:36 +01:00
parent cb01a159bc
commit 4561cea8d4
5 changed files with 16 additions and 10 deletions

View File

@@ -29,11 +29,13 @@ class ProfileController extends AbstractController
$userConnect = $token?->getUser();
$currentProfile = $profileRepo->findOneBy(['idParticipant' => $uuid]);
if ($userConnect->getIdParticipant() !== $currentProfile->getIdParticipant()) {
$this->addFlash('error', "Vous ne pouvez pas consulter un profil qui n'est pas le votre");
return $this->redirectToRoute('home');
$isActiveUser = false;
} else {
$isActiveUser = true;
}
return $this->render('profile/view.html.twig', [
'profile' => $currentProfile,
'isActiveUser' => $isActiveUser,
]);
}