From e7a3911c83806f0a11ebf00b96d7498815d718be Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 27 Apr 2015 11:40:10 +0200 Subject: check if encryption is enbaled before we start moving keys --- lib/private/encryption/update.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'lib/private/encryption/update.php') diff --git a/lib/private/encryption/update.php b/lib/private/encryption/update.php index a0b0af968c6..ddcee3bae93 100644 --- a/lib/private/encryption/update.php +++ b/lib/private/encryption/update.php @@ -81,11 +81,13 @@ class Update { * @param array $params */ public function postShared($params) { - if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { - $path = Filesystem::getPath($params['fileSource']); - list($owner, $ownerPath) = $this->getOwnerPath($path); - $absPath = '/' . $owner . '/files/' . $ownerPath; - $this->update($absPath); + if ($this->encryptionManager->isEnabled()) { + if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { + $path = Filesystem::getPath($params['fileSource']); + list($owner, $ownerPath) = $this->getOwnerPath($path); + $absPath = '/' . $owner . '/files/' . $ownerPath; + $this->update($absPath); + } } } @@ -95,11 +97,13 @@ class Update { * @param array $params */ public function postUnshared($params) { - if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { - $path = Filesystem::getPath($params['fileSource']); - list($owner, $ownerPath) = $this->getOwnerPath($path); - $absPath = '/' . $owner . '/files/' . $ownerPath; - $this->update($absPath); + if ($this->encryptionManager->isEnabled()) { + if ($params['itemType'] === 'file' || $params['itemType'] === 'folder') { + $path = Filesystem::getPath($params['fileSource']); + list($owner, $ownerPath) = $this->getOwnerPath($path); + $absPath = '/' . $owner . '/files/' . $ownerPath; + $this->update($absPath); + } } } -- cgit v1.2.3