summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-11-17 00:54:08 +0100
committerGitHub <noreply@github.com>2016-11-17 00:54:08 +0100
commit8a02647e659509b8ce118aab4b7d7a6243fca524 (patch)
treef7fe2b4fbfd0092063e0a6be0e67ebc257b5e682 /apps
parent204a0849b4cf8633f4cbe0f122ce90c9d0f9768c (diff)
parentb373f52fa8c0eb80338e5f06981f4a048f5720e1 (diff)
downloadnextcloud-server-8a02647e659509b8ce118aab4b7d7a6243fca524.tar.gz
nextcloud-server-8a02647e659509b8ce118aab4b7d7a6243fca524.zip
Merge pull request #2122 from nextcloud/downstream-26520
Hack to prevent warning for read-only wrapper in public links
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/appinfo/v1/publicwebdav.php8
-rw-r--r--apps/files_sharing/ajax/shareinfo.php3
2 files changed, 6 insertions, 5 deletions
diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php
index 670eadd5ea9..95fb71032d5 100644
--- a/apps/dav/appinfo/v1/publicwebdav.php
+++ b/apps/dav/appinfo/v1/publicwebdav.php
@@ -73,14 +73,12 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, func
$isReadable = $share->getPermissions() & \OCP\Constants::PERMISSION_READ;
$fileId = $share->getNodeId();
- /*
- if (!$isReadable) {
- return false;
- }*/
-
+ // FIXME: should not add storage wrappers outside of preSetup, need to find a better way
+ $previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(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));
});
+ \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
OC_Util::setupFS($owner);
$ownerView = \OC\Files\Filesystem::getView();
diff --git a/apps/files_sharing/ajax/shareinfo.php b/apps/files_sharing/ajax/shareinfo.php
index 75d6e6081ec..a32b0a07328 100644
--- a/apps/files_sharing/ajax/shareinfo.php
+++ b/apps/files_sharing/ajax/shareinfo.php
@@ -63,9 +63,12 @@ $path = $data['realPath'];
$isWritable = $share->getPermissions() & (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_CREATE);
if (!$isWritable) {
+ // FIXME: should not add storage wrappers outside of preSetup, need to find a better way
+ $previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false);
\OC\Files\Filesystem::addStorageWrapper('readonly', function ($mountPoint, $storage) {
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => \OCP\Constants::PERMISSION_READ + \OCP\Constants::PERMISSION_SHARE));
});
+ \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
}
$rootInfo = \OC\Files\Filesystem::getFileInfo($path);