Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-10-22 23:13:18 +0300
committerRoeland Jago Douma <roeland@famdouma.nl>2016-10-24 22:45:00 +0300
commit7a6dbeb3986b76740a4b19ea3553118d226f51c7 (patch)
tree4cb6cb43fe53187631671f325ced010964dadefd /apps/dav/appinfo/v1/publicwebdav.php
parente73a11d1060320917343679b15c126f0076ac46b (diff)
Make files_drop work
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/appinfo/v1/publicwebdav.php')
-rw-r--r--apps/dav/appinfo/v1/publicwebdav.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php
index b88c5847ab5..2177a4b3ed0 100644
--- a/apps/dav/appinfo/v1/publicwebdav.php
+++ b/apps/dav/appinfo/v1/publicwebdav.php
@@ -57,8 +57,9 @@ $serverFactory = new OCA\DAV\Connector\Sabre\ServerFactory(
$requestUri = \OC::$server->getRequest()->getRequestUri();
$linkCheckPlugin = new \OCA\DAV\Files\Sharing\PublicLinkCheckPlugin();
+$filesDropPlugin = new \OCA\DAV\Files\Sharing\FilesDropPlugin();
-$server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function (\Sabre\DAV\Server $server) use ($authBackend, $linkCheckPlugin) {
+$server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function (\Sabre\DAV\Server $server) use ($authBackend, $linkCheckPlugin, $filesDropPlugin) {
$isAjax = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest');
$federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application();
$federatedShareProvider = $federatedSharingApp->getFederatedShareProvider();
@@ -72,9 +73,10 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, func
$isReadable = $share->getPermissions() & \OCP\Constants::PERMISSION_READ;
$fileId = $share->getNodeId();
+ /*
if (!$isReadable) {
return false;
- }
+ }*/
\OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE));
@@ -86,10 +88,14 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, func
$fileInfo = $ownerView->getFileInfo($path);
$linkCheckPlugin->setFileInfo($fileInfo);
- return new \OC\Files\View($ownerView->getAbsolutePath($path));
+ $view = new \OC\Files\View($ownerView->getAbsolutePath($path));
+ $filesDropPlugin->setView($view);
+
+ return $view;
});
$server->addPlugin($linkCheckPlugin);
+$server->addPlugin($filesDropPlugin);
// And off we go!
$server->exec();