diff --git a/lib/DAV/CorePlugin.php b/lib/DAV/CorePlugin.php index 74350c28d6..dbd8976b17 100644 --- a/lib/DAV/CorePlugin.php +++ b/lib/DAV/CorePlugin.php @@ -645,6 +645,10 @@ public function httpCopy(RequestInterface $request, ResponseInterface $response) if (!$this->server->emit('beforeBind', [$copyInfo['destination']])) { return false; } + if (!$this->server->emit('beforeCopy', [$path, $copyInfo['destination']])) { + return false; + } + if ($copyInfo['destinationExists']) { if (!$this->server->emit('beforeUnbind', [$copyInfo['destination']])) { return false; @@ -653,6 +657,7 @@ public function httpCopy(RequestInterface $request, ResponseInterface $response) } $this->server->tree->copy($path, $copyInfo['destination']); + $this->server->emit('afterCopy', [$path, $copyInfo['destination']]); $this->server->emit('afterBind', [$copyInfo['destination']]); // If a resource was overwritten we should send a 204, otherwise a 201