bug correction

This commit is contained in:
Charles 2025-10-27 16:04:52 +01:00
parent a219f0f067
commit e6068fd538
1 changed files with 3 additions and 3 deletions

View File

@ -27,13 +27,13 @@ class UserChecker implements UserCheckerInterface
}
// check if the user account is active
if (method_exists($user, 'isActive') && $user->isActive()) {
if (method_exists($user, 'isActive') && !$user->isActive()) {
throw new CustomUserMessageAccountStatusException('Votre compte est désactivé.');
}
//check if the user is in an organization
$uo = $this->entityManager->getRepository(UsersOrganizations::class)->findOneBy(['users' => $user, 'isDeleted' => true]);
if ($uo === null) {
$uo = $this->entityManager->getRepository(UsersOrganizations::class)->findOneBy(['users' => $user, 'isActive' => true]);
if (!$uo) {
throw new CustomUserMessageAccountStatusException('Vous n\'êtes pas relié à une organisation. veuillez contacter un administrateur.');
}
}