summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorFlorin Peter <github@florin-peter.de>2013-05-01 11:04:40 +0200
committerFlorin Peter <github@florin-peter.de>2013-05-01 11:04:40 +0200
commitd3db4ee103903e97ec2cfb8430b14699f1f6e8ae (patch)
treec77ae2238caf316c6617df0c32d965c9c609fcd2 /apps/files_encryption
parent3579ba1e414da72f1975845b4963adde2869e0a8 (diff)
downloadnextcloud-server-d3db4ee103903e97ec2cfb8430b14699f1f6e8ae.tar.gz
nextcloud-server-d3db4ee103903e97ec2cfb8430b14699f1f6e8ae.zip
fixed re-share problems
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/hooks/hooks.php8
-rw-r--r--apps/files_encryption/lib/util.php15
2 files changed, 15 insertions, 8 deletions
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index 67d289ad68a..c0e493752a0 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -200,13 +200,13 @@ class Hooks {
$util = new Util($view, $userId);
$path = $util->fileIdToPath($params['itemSource']);
- //check if this is a reshare action, that's true if the item source is already shared with me
- $sharedItem = \OCP\Share::getItemSharedWithBySource($params['itemType'], $params['itemSource']);
+ //check if this is a reshare action, that's true if the item source is already shared with me
+ $sharedItem = \OCP\Share::getItemSharedWithBySource($params['itemType'], $params['fileSource']);
if ($sharedItem) {
// if it is a re-share than the file is located in my Shared folder
$path = '/Shared'.$sharedItem['file_target'];
} else {
- $path = $util->fileIdToPath($params['itemSource']);
+ $path = $util->fileIdToPath($params['fileSource']);
}
$sharingEnabled = \OCP\Share::isEnabled();
@@ -224,7 +224,7 @@ class Hooks {
$failed = array();
// Attempt to set shareKey
- if (!$util->setSharedFileKeyfiles($session, $usersSharing, $path)) {
+ if (!$util->setSharedFileKeyfiles($session, $usersSharing, $path)) {
$failed[] = $path;
}
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 4097250b252..eabb34f7ab0 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -983,14 +983,21 @@ class Util {
*/
public function getAllFiles($dir) {
$result = array();
-
- $content = $this->view->getDirectoryContent($this->userFilesDir.$dir);
+
+ $content = $this->view->getDirectoryContent($this->userFilesDir.$dir);
+
+ // handling for re shared folders
+ $path_split = explode( '/', $dir );
+ $shared = '';
+ if($path_split[1] === 'Shared') {
+ $shared = '/Shared';
+ }
foreach ($content as $c) {
if ($c['type'] === "dir" ) {
- $result = array_merge($result, $this->getAllFiles(substr($c['path'],5)));
+ $result = array_merge($result, $this->getAllFiles($shared.substr($c['path'],5)));
} else {
- $result[] = substr($c['path'], 5);
+ $result[] = $shared.substr($c['path'], 5);
}
}
return $result;