change expiry time
This commit is contained in:
parent
7dc369ee67
commit
2bf438cb27
|
|
@ -1008,10 +1008,10 @@ class UserController extends AbstractController
|
||||||
$uo->setIsActive(true);
|
$uo->setIsActive(true);
|
||||||
$this->entityManager->persist($uo);
|
$this->entityManager->persist($uo);
|
||||||
$this->entityManager->flush();
|
$this->entityManager->flush();
|
||||||
$this->loggerService->logUserAction($user->getId(), null, "User accepted invitation for organization id : {$orgId}");
|
$this->loggerService->logUserAction($user->getId(), $user->getId(), "User accepted invitation for organization id : {$orgId}");
|
||||||
$this->loggerService->logOrganizationInformation($orgId, $user->getId(), "User accepted invitation with uo id : {$uo->getId()}");
|
$this->loggerService->logOrganizationInformation($orgId, $user->getId(), "User accepted invitation with uo id : {$uo->getId()}");
|
||||||
}
|
}
|
||||||
return $this->render('security/login.html.twig');
|
return $this->render('security/login.html.twig', ['error'=> null, 'last_username' => $user->getEmail()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -364,10 +364,10 @@ class UserService
|
||||||
|
|
||||||
if ($uo->getStatut() === "INVITED") {
|
if ($uo->getStatut() === "INVITED") {
|
||||||
$statut = "INVITED";
|
$statut = "INVITED";
|
||||||
// if user invited but not accepted in 1 hour, set statut to EXPIRED
|
// if user invited but not accepted in 15 days, set statut to EXPIRED
|
||||||
$now = new DateTimeImmutable();
|
$now = new DateTimeImmutable();
|
||||||
$invitationTime = $uo->getModifiedAt();
|
$invitationTime = $uo->getModifiedAt();
|
||||||
$expiryTime = $invitationTime->modify('+1 hour');
|
$expiryTime = $invitationTime->modify('+15 days');
|
||||||
if ($now > $expiryTime) {
|
if ($now > $expiryTime) {
|
||||||
$statut = "EXPIRED";
|
$statut = "EXPIRED";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue