summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-04-26 14:53:11 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-04-28 09:38:21 +0200
commitab9a36e872173b34be2e678de0c452885e3b48d8 (patch)
tree76e34c578bfdde6ab46164f9e4227e4fe0cc351e /apps/dav/lib
parent9da697b11af2928a1470dcedc7ebf77e4a5f0730 (diff)
downloadnextcloud-server-ab9a36e872173b34be2e678de0c452885e3b48d8.tar.gz
nextcloud-server-ab9a36e872173b34be2e678de0c452885e3b48d8.zip
allow apps to set custom mount types
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index a4f3f363a5f..4c426dd1052 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -65,6 +65,7 @@ class FilesPlugin extends ServerPlugin {
const CHECKSUMS_PROPERTYNAME = '{http://owncloud.org/ns}checksums';
const DATA_FINGERPRINT_PROPERTYNAME = '{http://owncloud.org/ns}data-fingerprint';
const HAS_PREVIEW_PROPERTYNAME = '{http://nextcloud.org/ns}has-preview';
+ const MOUNT_TYPE_PROPERTYNAME = '{http://nextcloud.org/ns}mount-type';
/**
* Reference to main server object
@@ -159,6 +160,7 @@ class FilesPlugin extends ServerPlugin {
$server->protectedProperties[] = self::CHECKSUMS_PROPERTYNAME;
$server->protectedProperties[] = self::DATA_FINGERPRINT_PROPERTYNAME;
$server->protectedProperties[] = self::HAS_PREVIEW_PROPERTYNAME;
+ $server->protectedProperties[] = self::MOUNT_TYPE_PROPERTYNAME;
// normally these cannot be changed (RFC4918), but we want them modifiable through PROPPATCH
$allowedProperties = ['{DAV:}getetag'];
@@ -381,6 +383,10 @@ class FilesPlugin extends ServerPlugin {
return $node->getSize();
});
}
+
+ $propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function () use ($node) {
+ return $node->getFileInfo()->getMountPoint()->getMountType();
+ });
}
/**