mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Remove User_Adapter references
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
namespace Alchemy\Phrasea\Authorization;
|
namespace Alchemy\Phrasea\Authorization;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||||
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ServiceProviderInterface;
|
use Silex\ServiceProviderInterface;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
|
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
|
||||||
@@ -23,8 +24,8 @@ class AuthorizationServiceProvider implements ServiceProviderInterface
|
|||||||
$app['phraseanet.security_token'] = $app->share(function (PhraseaApplication $app) {
|
$app['phraseanet.security_token'] = $app->share(function (PhraseaApplication $app) {
|
||||||
$user = $app['authentication']->getUser();
|
$user = $app['authentication']->getUser();
|
||||||
|
|
||||||
if ($user instanceof \User_Adapter) {
|
if ($user instanceof User) {
|
||||||
return new PreAuthenticatedToken((string)$user->get_id(), null, 'fake', ['ROLE_USER']);
|
return new PreAuthenticatedToken((string)$user->getId(), null, 'fake', ['ROLE_USER']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new AnonymousToken('fake', 'anon.', []);
|
return new AnonymousToken('fake', 'anon.', []);
|
||||||
|
@@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Controller;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Authorization\AuthorizationChecker;
|
use Alchemy\Phrasea\Authorization\AuthorizationChecker;
|
||||||
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -27,7 +28,7 @@ abstract class BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \User_Adapter
|
* @return User
|
||||||
*/
|
*/
|
||||||
public function getAuthenticatedUser()
|
public function getAuthenticatedUser()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user