diff options
author | Florin Peter <github@florin-peter.de> | 2013-05-30 01:38:11 +0200 |
---|---|---|
committer | Florin Peter <github@florin-peter.de> | 2013-05-30 01:38:11 +0200 |
commit | 6d94b393bf501ead44281cd4c2ce2483e18ed47f (patch) | |
tree | cbf346f6ae171de8e7a08e5386421bda0bbe57b8 /apps/files_encryption/hooks | |
parent | 8c17f2622633af1ee3251383cb353abc197f7603 (diff) | |
download | nextcloud-server-6d94b393bf501ead44281cd4c2ce2483e18ed47f.tar.gz nextcloud-server-6d94b393bf501ead44281cd4c2ce2483e18ed47f.zip |
fix share and un-share for single file
Diffstat (limited to 'apps/files_encryption/hooks')
-rw-r--r-- | apps/files_encryption/hooks/hooks.php | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php index 9893cecc94e..eb9a2600d70 100644 --- a/apps/files_encryption/hooks/hooks.php +++ b/apps/files_encryption/hooks/hooks.php @@ -327,15 +327,14 @@ class Hooks { $sharingEnabled = \OCP\Share::isEnabled();
+ // get the path including mount point only if not a shared folder
+ if(strncmp($path, '/Shared' , strlen('/Shared') !== 0)) {
+ // get path including the the storage mount point
+ $path = $util->getPathWithMountPoint($params['itemSource']);
+ }
+
// if a folder was shared, get a list of all (sub-)folders
if ($params['itemType'] === 'folder') {
-
- // get the path including mount point only if not a shared folder
- if(strncmp($path, '/Shared' , strlen('/Shared') !== 0)) {
- // get path including the the storage mount point
- $path = $util->getPathWithMountPoint($params['itemSource']);
- }
-
$allFiles = $util->getAllFiles($path);
} else {
$allFiles = array($path);
@@ -383,17 +382,11 @@ class Hooks { // rebuild path
foreach ($targetPathSplit as $pathPart) {
-
if ($pathPart !== $sharedPart) {
-
$path = '/' . $pathPart . $path;
-
} else {
-
break;
-
}
-
}
// prefix path with Shared
@@ -411,19 +404,16 @@ class Hooks { }
}
- // if we unshare a folder we need a list of all (sub-)files
- if ( $params['itemType'] === 'folder' ) {
-
- // get the path including mount point only if not a shared folder
- if(strncmp($path, '/Shared' , strlen('/Shared') !== 0)) {
- // get path including the the storage mount point
- $path = $util->getPathWithMountPoint($params['itemSource']);
- }
+ // get the path including mount point only if not a shared folder
+ if(strncmp($path, '/Shared' , strlen('/Shared') !== 0)) {
+ // get path including the the storage mount point
+ $path = $util->getPathWithMountPoint($params['itemSource']);
+ }
+ // if we unshare a folder we need a list of all (sub-)files
+ if ($params['itemType'] === 'folder') {
$allFiles = $util->getAllFiles( $path );
-
} else {
-
$allFiles = array($path);
}
|