From c8ff8db409e8bfdb8ce06a929790e16566842f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Fri, 30 Oct 2015 19:44:56 +0100 Subject: [PATCH] Remove User_Adapter references --- .../Phrasea/Authorization/AuthorizationServiceProvider.php | 5 +++-- lib/Alchemy/Phrasea/Controller/BaseController.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Alchemy/Phrasea/Authorization/AuthorizationServiceProvider.php b/lib/Alchemy/Phrasea/Authorization/AuthorizationServiceProvider.php index b6868057fe..fa84168c28 100644 --- a/lib/Alchemy/Phrasea/Authorization/AuthorizationServiceProvider.php +++ b/lib/Alchemy/Phrasea/Authorization/AuthorizationServiceProvider.php @@ -10,6 +10,7 @@ namespace Alchemy\Phrasea\Authorization; use Alchemy\Phrasea\Application as PhraseaApplication; +use Alchemy\Phrasea\Model\Entities\User; use Silex\Application; use Silex\ServiceProviderInterface; 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) { $user = $app['authentication']->getUser(); - if ($user instanceof \User_Adapter) { - return new PreAuthenticatedToken((string)$user->get_id(), null, 'fake', ['ROLE_USER']); + if ($user instanceof User) { + return new PreAuthenticatedToken((string)$user->getId(), null, 'fake', ['ROLE_USER']); } return new AnonymousToken('fake', 'anon.', []); diff --git a/lib/Alchemy/Phrasea/Controller/BaseController.php b/lib/Alchemy/Phrasea/Controller/BaseController.php index e14e40bc51..ed0e440f47 100644 --- a/lib/Alchemy/Phrasea/Controller/BaseController.php +++ b/lib/Alchemy/Phrasea/Controller/BaseController.php @@ -11,6 +11,7 @@ namespace Alchemy\Phrasea\Controller; use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Authorization\AuthorizationChecker; +use Alchemy\Phrasea\Model\Entities\User; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Response; @@ -27,7 +28,7 @@ abstract class BaseController } /** - * @return \User_Adapter + * @return User */ public function getAuthenticatedUser() {