conflic reslved

This commit is contained in:
jleroy2023
2024-11-25 11:59:39 +01:00
9 changed files with 38 additions and 183 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,
]);
}