Update to Symfony 4.1 #149 (#160)

* updated to Symfony 4.1 #149
* updated to phpunit 7 #149
* downgrade ocramius/proxy-manager for PHP 7.1 compatibility #149
* fixed symfony deprecations #149
* replaced AdvancedUserInterface with custom user checker
* code sniffer fixes
This commit is contained in:
Kevin Papst
2018-06-18 22:26:00 +02:00
committed by GitHub
parent 4e629fcaf8
commit bfa32a90db
14 changed files with 869 additions and 801 deletions

View File

@@ -0,0 +1,37 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Security;
use App\Entity\User;
use Symfony\Component\Security\Core\Exception\LockedException;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* Advanced checks during aithentication to make sure the user is allowed to use Kimai.
*/
class UserChecker implements UserCheckerInterface
{
public function checkPreAuth(UserInterface $user)
{
}
public function checkPostAuth(UserInterface $user)
{
if (!$user instanceof User) {
return;
}
// user account is not enabled, the user may be notified
if (!$user->isEnabled()) {
throw new LockedException();
}
}
}