mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix: Add user data.
This commit is contained in:
parent
f7fabdbf1c
commit
c1e2fd64ff
@ -18,6 +18,7 @@ use loophp\psr17\Psr17Interface;
|
||||
use Psr\Http\Client\ClientInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
final class ChillWopi implements WopiInterface
|
||||
{
|
||||
@ -31,18 +32,22 @@ final class ChillWopi implements WopiInterface
|
||||
|
||||
private TempUrlGeneratorInterface $tempUrlGeneratorInterface;
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(
|
||||
Psr17Interface $psr17,
|
||||
WopiDiscoveryInterface $wopiDiscovery,
|
||||
StoredObjectRepository $storedObjectRepository,
|
||||
ClientInterface $httpClient,
|
||||
TempUrlGeneratorInterface $tempUrlGeneratorInterface
|
||||
TempUrlGeneratorInterface $tempUrlGeneratorInterface,
|
||||
Security $security
|
||||
) {
|
||||
$this->psr17 = $psr17;
|
||||
$this->wopiDiscovery = $wopiDiscovery;
|
||||
$this->storedObjectRepository = $storedObjectRepository;
|
||||
$this->httpClient = $httpClient;
|
||||
$this->tempUrlGeneratorInterface = $tempUrlGeneratorInterface;
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
public function checkFileInfo(
|
||||
@ -69,15 +74,15 @@ final class ChillWopi implements WopiInterface
|
||||
->withBody($this->psr17->createStream((string) json_encode(
|
||||
[
|
||||
'BaseFileName' => $storedObject->getFilename(),
|
||||
'OwnerId' => uniqid(),
|
||||
'OwnerId' => $this->security->getUser()->getUsername(),
|
||||
'Size' => 0,
|
||||
'UserId' => uniqid(),
|
||||
'Version' => 'v' . uniqid(),
|
||||
'UserId' => $this->security->getUser()->getUsername(),
|
||||
// 'Version' => 'v' . uniqid(),
|
||||
'ReadOnly' => false,
|
||||
'UserCanWrite' => true,
|
||||
'UserCanNotWriteRelative' => false,
|
||||
'SupportsLocks' => true,
|
||||
'UserFriendlyName' => 'User Name ' . uniqid(),
|
||||
'UserFriendlyName' => sprintf('User %s', $this->security->getUser()->getUsername()),
|
||||
'UserExtraInfo' => [],
|
||||
'LastModifiedTime' => date('Y-m-d\TH:i:s.u\Z', $storedObject->getCreationDate()->getTimestamp()),
|
||||
'CloseButtonClosesWindow' => true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user