summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/lib/util.php')
-rw-r--r--apps/files_encryption/lib/util.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index c3058aefa6f..b86815021a8 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1127,8 +1127,9 @@ class Util {
* @brief Find, sanitise and format users sharing a file
* @note This wraps other methods into a portable bundle
* @param boolean $sharingEnabled
+ * @param string $filePath path relativ to current users files folder
*/
- public function getSharingUsersArray($sharingEnabled, $filePath, $currentUserId = false) {
+ public function getSharingUsersArray($sharingEnabled, $filePath) {
$appConfig = \OC::$server->getAppConfig();
@@ -1147,12 +1148,14 @@ class Util {
$ownerPath = \OCA\Encryption\Helper::stripPartialFileExtension($ownerPath);
- $userIds = array();
+ // always add owner to the list of users with access to the file
+ $userIds = array($owner);
+
if ($sharingEnabled) {
// Find out who, if anyone, is sharing the file
- $result = \OCP\Share::getUsersSharingFile($ownerPath, $owner, true);
- $userIds = $result['users'];
+ $result = \OCP\Share::getUsersSharingFile($ownerPath, $owner);
+ $userIds = \array_merge($userIds, $result['users']);
if ($result['public']) {
$userIds[] = $this->publicShareKeyId;
}
@@ -1168,11 +1171,6 @@ class Util {
$userIds[] = $recoveryKeyId;
}
- // add current user if given
- if ($currentUserId !== false) {
- $userIds[] = $currentUserId;
- }
-
// check if it is a group mount
if (\OCP\App::isEnabled("files_external")) {
$mount = \OC_Mount_Config::getSystemMountPoints();