aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Connector/Sabre/FilesPlugin.php
diff options
context:
space:
mode:
authortobiasKaminsky <tobias@kaminsky.me>2018-12-05 15:20:44 +0100
committertobiasKaminsky <tobias@kaminsky.me>2019-02-27 07:11:40 +0100
commit78e6bf0daf01e9934f799a9739b7b87244cd512d (patch)
tree6995ed737c4097a40b415c6a5a3120739f88b25a /apps/dav/lib/Connector/Sabre/FilesPlugin.php
parent36b01e3c2d4033f690b30b4fcf92711da28cb2ed (diff)
downloadnextcloud-server-78e6bf0daf01e9934f799a9739b7b87244cd512d.tar.gz
nextcloud-server-78e6bf0daf01e9934f799a9739b7b87244cd512d.zip
Add note to dav endpoint
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Diffstat (limited to 'apps/dav/lib/Connector/Sabre/FilesPlugin.php')
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index f53f13c5687..99317f2bc1c 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -70,6 +70,7 @@ class FilesPlugin extends ServerPlugin {
const HAS_PREVIEW_PROPERTYNAME = '{http://nextcloud.org/ns}has-preview';
const MOUNT_TYPE_PROPERTYNAME = '{http://nextcloud.org/ns}mount-type';
const IS_ENCRYPTED_PROPERTYNAME = '{http://nextcloud.org/ns}is-encrypted';
+ const SHARE_NOTE = '{http://nextcloud.org/ns}note';
/**
* Reference to main server object
@@ -161,6 +162,7 @@ class FilesPlugin extends ServerPlugin {
$server->protectedProperties[] = self::HAS_PREVIEW_PROPERTYNAME;
$server->protectedProperties[] = self::MOUNT_TYPE_PROPERTYNAME;
$server->protectedProperties[] = self::IS_ENCRYPTED_PROPERTYNAME;
+ $server->protectedProperties[] = self::SHARE_NOTE;
// normally these cannot be changed (RFC4918), but we want them modifiable through PROPPATCH
$allowedProperties = ['{DAV:}getetag'];
@@ -359,6 +361,12 @@ class FilesPlugin extends ServerPlugin {
$propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function () use ($node) {
return $node->getFileInfo()->getMountPoint()->getMountType();
});
+
+ $propFind->handle(self::SHARE_NOTE, function() use ($node, $httpRequest) {
+ return $node->getNoteFromShare(
+ $httpRequest->getRawServerValue('PHP_AUTH_USER')
+ );
+ });
}
if ($node instanceof \OCA\DAV\Connector\Sabre\Node) {