mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
Remove User_Adapter references
This commit is contained in:
@@ -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.', []);
|
||||
|
@@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user