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\Client\ClientInterface;
|
||||||
use Psr\Http\Message\RequestInterface;
|
use Psr\Http\Message\RequestInterface;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
|
use Symfony\Component\Security\Core\Security;
|
||||||
|
|
||||||
final class ChillWopi implements WopiInterface
|
final class ChillWopi implements WopiInterface
|
||||||
{
|
{
|
||||||
@ -31,18 +32,22 @@ final class ChillWopi implements WopiInterface
|
|||||||
|
|
||||||
private TempUrlGeneratorInterface $tempUrlGeneratorInterface;
|
private TempUrlGeneratorInterface $tempUrlGeneratorInterface;
|
||||||
|
|
||||||
|
private Security $security;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
Psr17Interface $psr17,
|
Psr17Interface $psr17,
|
||||||
WopiDiscoveryInterface $wopiDiscovery,
|
WopiDiscoveryInterface $wopiDiscovery,
|
||||||
StoredObjectRepository $storedObjectRepository,
|
StoredObjectRepository $storedObjectRepository,
|
||||||
ClientInterface $httpClient,
|
ClientInterface $httpClient,
|
||||||
TempUrlGeneratorInterface $tempUrlGeneratorInterface
|
TempUrlGeneratorInterface $tempUrlGeneratorInterface,
|
||||||
|
Security $security
|
||||||
) {
|
) {
|
||||||
$this->psr17 = $psr17;
|
$this->psr17 = $psr17;
|
||||||
$this->wopiDiscovery = $wopiDiscovery;
|
$this->wopiDiscovery = $wopiDiscovery;
|
||||||
$this->storedObjectRepository = $storedObjectRepository;
|
$this->storedObjectRepository = $storedObjectRepository;
|
||||||
$this->httpClient = $httpClient;
|
$this->httpClient = $httpClient;
|
||||||
$this->tempUrlGeneratorInterface = $tempUrlGeneratorInterface;
|
$this->tempUrlGeneratorInterface = $tempUrlGeneratorInterface;
|
||||||
|
$this->security = $security;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkFileInfo(
|
public function checkFileInfo(
|
||||||
@ -69,15 +74,15 @@ final class ChillWopi implements WopiInterface
|
|||||||
->withBody($this->psr17->createStream((string) json_encode(
|
->withBody($this->psr17->createStream((string) json_encode(
|
||||||
[
|
[
|
||||||
'BaseFileName' => $storedObject->getFilename(),
|
'BaseFileName' => $storedObject->getFilename(),
|
||||||
'OwnerId' => uniqid(),
|
'OwnerId' => $this->security->getUser()->getUsername(),
|
||||||
'Size' => 0,
|
'Size' => 0,
|
||||||
'UserId' => uniqid(),
|
'UserId' => $this->security->getUser()->getUsername(),
|
||||||
'Version' => 'v' . uniqid(),
|
// 'Version' => 'v' . uniqid(),
|
||||||
'ReadOnly' => false,
|
'ReadOnly' => false,
|
||||||
'UserCanWrite' => true,
|
'UserCanWrite' => true,
|
||||||
'UserCanNotWriteRelative' => false,
|
'UserCanNotWriteRelative' => false,
|
||||||
'SupportsLocks' => true,
|
'SupportsLocks' => true,
|
||||||
'UserFriendlyName' => 'User Name ' . uniqid(),
|
'UserFriendlyName' => sprintf('User %s', $this->security->getUser()->getUsername()),
|
||||||
'UserExtraInfo' => [],
|
'UserExtraInfo' => [],
|
||||||
'LastModifiedTime' => date('Y-m-d\TH:i:s.u\Z', $storedObject->getCreationDate()->getTimestamp()),
|
'LastModifiedTime' => date('Y-m-d\TH:i:s.u\Z', $storedObject->getCreationDate()->getTimestamp()),
|
||||||
'CloseButtonClosesWindow' => true,
|
'CloseButtonClosesWindow' => true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user