aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2017-08-29 10:47:33 +0200
committerGitHub <noreply@github.com>2017-08-29 10:47:33 +0200
commit5adc1efe9fef473bb81414682386d1b0563ff859 (patch)
treecf119e07c6af0324c0961b9c64c6e51eab9145a7
parentdaf2d6cb961b5c202fe667c21fd45aaf77ffbe57 (diff)
parente83e1c7c23c99a84c1d6d02d18da37d836124dfd (diff)
downloadnextcloud-server-5adc1efe9fef473bb81414682386d1b0563ff859.tar.gz
nextcloud-server-5adc1efe9fef473bb81414682386d1b0563ff859.zip
Merge pull request #6283 from nextcloud/add-new-propfind
add propfind to detect encryption status
-rw-r--r--apps/dav/lib/Connector/Sabre/FilesPlugin.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
index 726dd13cced..5655f0355ac 100644
--- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php
@@ -66,6 +66,7 @@ class FilesPlugin extends ServerPlugin {
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';
+ const IS_ENCRYPTED_PROPERTYNAME = '{http://nextcloud.org/ns}is-encrypted';
/**
* Reference to main server object
@@ -146,7 +147,6 @@ class FilesPlugin extends ServerPlugin {
* @return void
*/
public function initialize(\Sabre\DAV\Server $server) {
-
$server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
$server->xml->namespaceMap[self::NS_NEXTCLOUD] = 'nc';
$server->protectedProperties[] = self::FILEID_PROPERTYNAME;
@@ -161,6 +161,7 @@ class FilesPlugin extends ServerPlugin {
$server->protectedProperties[] = self::DATA_FINGERPRINT_PROPERTYNAME;
$server->protectedProperties[] = self::HAS_PREVIEW_PROPERTYNAME;
$server->protectedProperties[] = self::MOUNT_TYPE_PROPERTYNAME;
+ $server->protectedProperties[] = self::IS_ENCRYPTED_PROPERTYNAME;
// normally these cannot be changed (RFC4918), but we want them modifiable through PROPPATCH
$allowedProperties = ['{DAV:}getetag'];
@@ -343,6 +344,11 @@ class FilesPlugin extends ServerPlugin {
}
});
+ $propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function() use ($node) {
+ $result = $node->getFileInfo()->isEncrypted() ? '1' : '0';
+ return $result;
+ });
+
$propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) {
return json_encode($this->previewManager->isAvailable($node->getFileInfo()));
});