Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2017-05-25 14:48:57 +0300
committerGitHub <noreply@github.com>2017-05-25 14:48:57 +0300
commit35e246482dd7b19eb4d5250854405a9cad8f649d (patch)
tree43880bffdb80d14c9a0a0b917a9a127c5ebdbe03
parent377eeae143309cdc44a058626bcf32b5d92b05a8 (diff)
parentc14ff8fee8b3a64212aed0de0aa832581edb6e8d (diff)
Merge pull request #78 from pranavk/enc
Guard encryption support
-rw-r--r--lib/Controller/DocumentController.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Controller/DocumentController.php b/lib/Controller/DocumentController.php
index d854945b..62f81c85 100644
--- a/lib/Controller/DocumentController.php
+++ b/lib/Controller/DocumentController.php
@@ -116,12 +116,16 @@ class DocumentController extends Controller {
'instanceId' => $this->settings->getSystemValue('instanceid'),
];
- // Update the current file to be accessible with system public shared key
- $owner = $item->getOwner()->getUID();
- $absPath = '/' . $owner . '/' . $item->getInternalPath();
- $accessList = \OC::$server->getEncryptionFilesHelper()->getAccessList($absPath);
- $accessList['public'] = true;
- \OC::$server->getEncryptionManager()->getEncryptionModule()->update($absPath, $owner, $accessList);
+ $encryptionManager = \OC::$server->getEncryptionManager();
+ if ($encryptionManager->isEnabled())
+ {
+ // Update the current file to be accessible with system public shared key
+ $owner = $item->getOwner()->getUID();
+ $absPath = '/' . $owner . '/' . $item->getInternalPath();
+ $accessList = \OC::$server->getEncryptionFilesHelper()->getAccessList($absPath);
+ $accessList['public'] = true;
+ $encryptionManager->getEncryptionModule()->update($absPath, $owner, $accessList);
+ }
$response = new TemplateResponse('richdocuments', 'documents', $params, 'empty');
$policy = new ContentSecurityPolicy();