Merge pull request #78 from pranavk/enc

Guard encryption support
pull/82/head
Andras Timar 7 years ago committed by GitHub
commit 35e246482d

@ -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();

Loading…
Cancel
Save