mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-31 07:09:45 +02:00
Applied rector with PHP8.1 migration rules
This commit is contained in:
parent
dc6a67c2f0
commit
7ee01d9a05
303 changed files with 1228 additions and 3465 deletions
|
@ -55,13 +55,9 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
|
|||
* @var string The route the user will redirected to, if he needs to change this password
|
||||
*/
|
||||
public const REDIRECT_TARGET = 'user_settings';
|
||||
private \Symfony\Bundle\SecurityBundle\Security $security;
|
||||
private HttpUtils $httpUtils;
|
||||
|
||||
public function __construct(\Symfony\Bundle\SecurityBundle\Security $security, HttpUtils $httpUtils)
|
||||
public function __construct(private readonly \Symfony\Bundle\SecurityBundle\Security $security, private readonly HttpUtils $httpUtils)
|
||||
{
|
||||
$this->security = $security;
|
||||
$this->httpUtils = $httpUtils;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +125,7 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
|
|||
{
|
||||
$tfa_enabled = $user->isWebAuthnAuthenticatorEnabled() || $user->isGoogleAuthenticatorEnabled();
|
||||
|
||||
return null !== $user->getGroup() && $user->getGroup()->isEnforce2FA() && !$tfa_enabled;
|
||||
return $user->getGroup() instanceof \App\Entity\UserSystem\Group && $user->getGroup()->isEnforce2FA() && !$tfa_enabled;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents(): array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue