Guard encryption support

(cherry picked from commit c14ff8fee8b3a64212aed0de0aa832581edb6e8d)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
Pranav Kant 2017-05-25 17:07:21 +05:30 committed by Andras Timar
parent c99ec2d615
commit 9afe6fb69c

View File

@ -111,12 +111,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();