aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-06-25 16:41:51 +0200
committerBjörn Schießle <schiessle@owncloud.com>2013-07-05 16:00:08 +0200
commit93730a090be9587a5b6c52fe52afaba0a48be1e9 (patch)
treeecbe1034237f475aa581318b346e0d1cfc5faf62 /apps
parentaf2cd6f5418078e813e4b3cad27cc859273592de (diff)
downloadnextcloud-server-93730a090be9587a5b6c52fe52afaba0a48be1e9.tar.gz
nextcloud-server-93730a090be9587a5b6c52fe52afaba0a48be1e9.zip
del share keys from correct location
Diffstat (limited to 'apps')
-rwxr-xr-xapps/files_encryption/lib/keymanager.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php
index 0f608843740..8de1d413642 100755
--- a/apps/files_encryption/lib/keymanager.php
+++ b/apps/files_encryption/lib/keymanager.php
@@ -475,10 +475,19 @@ class Keymanager {
*/
public static function delAllShareKeys(\OC_FilesystemView $view, $userId, $filePath) {
+ $util = new util($view, $userId);
+
+ if ($util->isSystemWideMountPoint($filePath)) {
+ $baseDir = '/files_encryption/share-keys/';
+ } else {
+ $baseDir = $userId . '/files_encryption/share-keys/';
+ }
+
+
if ($view->is_dir($userId . '/files/' . $filePath)) {
- $view->unlink($userId . '/files_encryption/share-keys/' . $filePath);
+ $view->unlink($baseDir . $filePath);
} else {
- $localKeyPath = $view->getLocalFile($userId . '/files_encryption/share-keys/' . $filePath);
+ $localKeyPath = $view->getLocalFile($baseDir . $filePath);
$matches = glob(preg_quote($localKeyPath) . '*.shareKey');
foreach ($matches as $ma) {
$result = unlink($ma);
@@ -503,7 +512,11 @@ class Keymanager {
list($owner, $filename) = $util->getUidAndFilename($filePath);
- $shareKeyPath = \OC\Files\Filesystem::normalizePath('/' . $owner . '/files_encryption/share-keys/' . $filename);
+ if ($util->isSystemWideMountPoint($filename)) {
+ $shareKeyPath = \OC\Files\Filesystem::normalizePath('/files_encryption/share-keys/' . $filename);
+ } else {
+ $shareKeyPath = \OC\Files\Filesystem::normalizePath('/' . $owner . '/files_encryption/share-keys/' . $filename);
+ }
if ($view->is_dir($shareKeyPath)) {