diff options
author | Robin Appelman <robin@icewind.nl> | 2021-02-10 13:53:05 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2021-02-12 17:33:12 +0100 |
commit | f824f273b62ada6b80fede8f8e3d320e4666caae (patch) | |
tree | 3bd5b8f285777c0837fa5a0732c4a779c601d5fe /apps/dav/lib/Direct/ServerFactory.php | |
parent | 361f160d0daa4c3baf84c801118c0d85886aa6d9 (diff) | |
download | nextcloud-server-f824f273b62ada6b80fede8f8e3d320e4666caae.tar.gz nextcloud-server-f824f273b62ada6b80fede8f8e3d320e4666caae.zip |
add event for when a direct download is triggered
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib/Direct/ServerFactory.php')
-rw-r--r-- | apps/dav/lib/Direct/ServerFactory.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/apps/dav/lib/Direct/ServerFactory.php b/apps/dav/lib/Direct/ServerFactory.php index 74496b8cc56..d84bb208d3f 100644 --- a/apps/dav/lib/Direct/ServerFactory.php +++ b/apps/dav/lib/Direct/ServerFactory.php @@ -28,22 +28,27 @@ declare(strict_types=1); namespace OCA\DAV\Direct; use OC\Security\Bruteforce\Throttler; +use OCA\DAV\Connector\Sabre\MaintenancePlugin; use OCA\DAV\Db\DirectMapper; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\IRootFolder; use OCP\IConfig; use OCP\IL10N; use OCP\IRequest; +use OCP\L10N\IFactory; class ServerFactory { /** @var IConfig */ private $config; /** @var IL10N */ private $l10n; + private $eventDispatcher; - public function __construct(IConfig $config, IL10N $l10n) { + public function __construct(IConfig $config, IFactory $l10nFactory, IEventDispatcher $eventDispatcher) { $this->config = $config; - $this->l10n = $l10n; + $this->l10n = $l10nFactory->get('dav'); + $this->eventDispatcher = $eventDispatcher; } public function createServer(string $baseURI, @@ -53,13 +58,13 @@ class ServerFactory { ITimeFactory $timeFactory, Throttler $throttler, IRequest $request): Server { - $home = new DirectHome($rootFolder, $mapper, $timeFactory, $throttler, $request); + $home = new DirectHome($rootFolder, $mapper, $timeFactory, $throttler, $request, $this->eventDispatcher); $server = new Server($home); $server->httpRequest->setUrl($requestURI); $server->setBaseUri($baseURI); - $server->addPlugin(new \OCA\DAV\Connector\Sabre\MaintenancePlugin($this->config, $this->l10n)); + $server->addPlugin(new MaintenancePlugin($this->config, $this->l10n)); return $server; } |