From 73486d686093f106222c6f0b9ad8b9f523765248 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 19 Aug 2021 16:49:55 +0200 Subject: [PATCH] Update checkFileInfo --- .../ChillWopiBundle/src/Service/Wopi/ChillWopi.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php index b8715eb47..baf22529c 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php @@ -19,7 +19,6 @@ use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; -use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\User\UserProviderInterface; final class ChillWopi implements WopiInterface @@ -34,8 +33,6 @@ final class ChillWopi implements WopiInterface private TempUrlGeneratorInterface $tempUrlGenerator; - private Security $security; - private UserProviderInterface $userProvider; public function __construct( @@ -44,7 +41,6 @@ final class ChillWopi implements WopiInterface StoredObjectRepository $storedObjectRepository, ClientInterface $httpClient, TempUrlGeneratorInterface $tempUrlGenerator, - Security $security, UserProviderInterface $userProvider ) { $this->psr17 = $psr17; @@ -52,7 +48,6 @@ final class ChillWopi implements WopiInterface $this->storedObjectRepository = $storedObjectRepository; $this->httpClient = $httpClient; $this->tempUrlGenerator = $tempUrlGenerator; - $this->security = $security; $this->userProvider = $userProvider; } @@ -88,9 +83,9 @@ final class ChillWopi implements WopiInterface ->withBody($this->psr17->createStream((string) json_encode( [ 'BaseFileName' => $storedObject->getFilename(), - 'OwnerId' => $user->getUsername(), + 'OwnerId' => uniqid(), 'Size' => 0, - 'UserId' => $user->getUsername(), + 'UserId' => uniqid(), // 'Version' => 'v' . uniqid(), 'ReadOnly' => false, 'UserCanWrite' => true,