Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
f6ac34af
Commit
f6ac34af
authored
12 years ago
by
Florin Peter
Browse files
Options
Downloads
Patches
Plain Diff
improved handling for getSharingUsersArray
parent
8790ceba
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/files_encryption/lib/proxy.php
+1
-1
1 addition, 1 deletion
apps/files_encryption/lib/proxy.php
apps/files_encryption/lib/stream.php
+3
-7
3 additions, 7 deletions
apps/files_encryption/lib/stream.php
apps/files_encryption/lib/util.php
+7
-2
7 additions, 2 deletions
apps/files_encryption/lib/util.php
with
11 additions
and
10 deletions
apps/files_encryption/lib/proxy.php
+
1
−
1
View file @
f6ac34af
...
...
@@ -134,7 +134,7 @@ class Proxy extends \OC_FileProxy {
$sharingEnabled
=
\OCP\Share
::
isEnabled
();
$uniqueUserIds
=
$util
->
getSharingUsersArray
(
$sharingEnabled
,
$filePath
);
$uniqueUserIds
=
$util
->
getSharingUsersArray
(
$sharingEnabled
,
$filePath
,
$userId
);
// Fetch public keys for all users who will share the file
$publicKeys
=
Keymanager
::
getPublicKeys
(
$rootView
,
$uniqueUserIds
);
...
...
This diff is collapsed.
Click to expand it.
apps/files_encryption/lib/stream.php
+
3
−
7
View file @
f6ac34af
...
...
@@ -335,12 +335,8 @@ class Stream {
$util
=
new
Util
(
$this
->
rootView
,
$this
->
userId
);
// Get all users sharing the file
$uniqueUserIds
=
$util
->
getSharingUsersArray
(
$sharingEnabled
,
$this
->
relPath
);
// allways add current user
$uniqueUserIds
[]
=
$this
->
userId
;
array_unique
(
$uniqueUserIds
);
// Get all users sharing the file includes current user
$uniqueUserIds
=
$util
->
getSharingUsersArray
(
$sharingEnabled
,
$this
->
relPath
,
$this
->
userId
);
// Fetch public keys for all sharing users
$publicKeys
=
Keymanager
::
getPublicKeys
(
$this
->
rootView
,
$uniqueUserIds
);
...
...
This diff is collapsed.
Click to expand it.
apps/files_encryption/lib/util.php
+
7
−
2
View file @
f6ac34af
...
...
@@ -848,7 +848,7 @@ class Util {
* @brief Find, sanitise and format users sharing a file
* @note This wraps other methods into a portable bundle
*/
public
function
getSharingUsersArray
(
$sharingEnabled
,
$filePath
)
{
public
function
getSharingUsersArray
(
$sharingEnabled
,
$filePath
,
$currentUserId
=
false
)
{
// Check if key recovery is enabled
$recoveryEnabled
=
$this
->
recoveryEnabled
();
...
...
@@ -879,6 +879,11 @@ class Util {
}
// add current user if given
if
(
$currentUserId
!=
false
)
{
$userIds
[]
=
$currentUserId
;
}
// Remove duplicate UIDs
$uniqueUserIds
=
array_unique
(
$userIds
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment