summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-17 13:40:25 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-17 13:40:25 +0100
commit20c251a5755f7c218df2cafe9d5ba64036096815 (patch)
tree395609ac9ccc634987e4adbfca689fcab6f20832 /apps/dav/lib
parent74ce6d29e1dc2638911e52c2486e55b64538d6d8 (diff)
parentd62f410f92f32008edd3d127b1005b4754a54319 (diff)
downloadnextcloud-server-20c251a5755f7c218df2cafe9d5ba64036096815.tar.gz
nextcloud-server-20c251a5755f7c218df2cafe9d5ba64036096815.zip
Merge pull request #20188 from owncloud/webdav-exposeshareowner
Expose share owner id and display name via files webdav
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/connector/sabre/filesplugin.php14
-rw-r--r--apps/dav/lib/connector/sabre/node.php4
2 files changed, 18 insertions, 0 deletions
diff --git a/apps/dav/lib/connector/sabre/filesplugin.php b/apps/dav/lib/connector/sabre/filesplugin.php
index 61b5360cac1..00d5d2cd725 100644
--- a/apps/dav/lib/connector/sabre/filesplugin.php
+++ b/apps/dav/lib/connector/sabre/filesplugin.php
@@ -42,6 +42,8 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
const SIZE_PROPERTYNAME = '{http://owncloud.org/ns}size';
const GETETAG_PROPERTYNAME = '{DAV:}getetag';
const LASTMODIFIED_PROPERTYNAME = '{DAV:}lastmodified';
+ const OWNER_ID_PROPERTYNAME = '{http://owncloud.org/ns}owner-id';
+ const OWNER_DISPLAY_NAME_PROPERTYNAME = '{http://owncloud.org/ns}owner-display-name';
/**
* Reference to main server object
@@ -99,6 +101,8 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
$server->protectedProperties[] = self::PERMISSIONS_PROPERTYNAME;
$server->protectedProperties[] = self::SIZE_PROPERTYNAME;
$server->protectedProperties[] = self::DOWNLOADURL_PROPERTYNAME;
+ $server->protectedProperties[] = self::OWNER_ID_PROPERTYNAME;
+ $server->protectedProperties[] = self::OWNER_DISPLAY_NAME_PROPERTYNAME;
// normally these cannot be changed (RFC4918), but we want them modifiable through PROPPATCH
$allowedProperties = ['{DAV:}getetag'];
@@ -201,6 +205,16 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
return $node->getSize();
});
}
+
+ $propFind->handle(self::OWNER_ID_PROPERTYNAME, function() use ($node) {
+ $owner = $node->getOwner();
+ return $owner->getUID();
+ });
+ $propFind->handle(self::OWNER_DISPLAY_NAME_PROPERTYNAME, function() use ($node) {
+ $owner = $node->getOwner();
+ $displayName = $owner->getDisplayName();
+ return $displayName;
+ });
}
/**
diff --git a/apps/dav/lib/connector/sabre/node.php b/apps/dav/lib/connector/sabre/node.php
index 814aaceb077..ae7dd51fc94 100644
--- a/apps/dav/lib/connector/sabre/node.php
+++ b/apps/dav/lib/connector/sabre/node.php
@@ -238,6 +238,10 @@ abstract class Node implements \Sabre\DAV\INode {
return $p;
}
+ public function getOwner() {
+ return $this->info->getOwner();
+ }
+
protected function verifyPath() {
try {
$fileName = basename($this->info->getPath());