mirror of
https://github.com/resources-manager/resources-manager-webui.git
synced 2024-12-26 13:18:05 +01:00
plop
This commit is contained in:
parent
375cbbc281
commit
12ac1aba25
|
@ -14,8 +14,11 @@ security:
|
|||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
|
||||
main:
|
||||
anonymous: ~
|
||||
pattern: ^/
|
||||
user_checker: App\Security\UserChecker
|
||||
guard:
|
||||
authenticators:
|
||||
- App\Security\LoginFormAuthentificatorAuthenticator
|
||||
|
|
36
src/Security/UserChecker.php
Normal file
36
src/Security/UserChecker.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
namespace App\Security;
|
||||
|
||||
use App\Exception\AccountDeletedException;
|
||||
use App\Security\User as AppUser;
|
||||
use Symfony\Component\Security\Core\Exception\AccountExpiredException;
|
||||
use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException;
|
||||
use Symfony\Component\Security\Core\User\UserCheckerInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
class UserChecker implements UserCheckerInterface
|
||||
{
|
||||
public function checkPreAuth(UserInterface $user)
|
||||
{
|
||||
if (!$user instanceof AppUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
// user is not activated
|
||||
if ($user-> getActive() === false) {
|
||||
throw new AccountDeletedException();
|
||||
}
|
||||
}
|
||||
|
||||
public function checkPostAuth(UserInterface $user)
|
||||
{
|
||||
if (!$user instanceof AppUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
// user is not activated
|
||||
if ($user->getActive() === false) {
|
||||
throw new AccountDeletedException();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user