Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
8e348123
Commit
8e348123
authored
11 years ago
by
Björn Schießle
Browse files
Options
Downloads
Patches
Plain Diff
always encrypt files to owner
parent
65e3f634
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/files_encryption/lib/stream.php
+1
-1
1 addition, 1 deletion
apps/files_encryption/lib/stream.php
apps/files_encryption/lib/util.php
+7
-9
7 additions, 9 deletions
apps/files_encryption/lib/util.php
lib/public/share.php
+3
-3
3 additions, 3 deletions
lib/public/share.php
with
11 additions
and
13 deletions
apps/files_encryption/lib/stream.php
+
1
−
1
View file @
8e348123
...
...
@@ -545,7 +545,7 @@ class Stream {
$util
=
new
Util
(
$this
->
rootView
,
$this
->
userId
);
// Get all users sharing the file includes current user
$uniqueUserIds
=
$util
->
getSharingUsersArray
(
$sharingEnabled
,
$this
->
relPath
,
$this
->
userId
);
$uniqueUserIds
=
$util
->
getSharingUsersArray
(
$sharingEnabled
,
$this
->
relPath
);
$checkedUserIds
=
$util
->
filterShareReadyUsers
(
$uniqueUserIds
);
// Fetch public keys for all sharing users
...
...
This diff is collapsed.
Click to expand it.
apps/files_encryption/lib/util.php
+
7
−
9
View file @
8e348123
...
...
@@ -1124,8 +1124,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
();
...
...
@@ -1144,12 +1145,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
;
}
...
...
@@ -1165,11 +1168,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
();
...
...
This diff is collapsed.
Click to expand it.
lib/public/share.php
+
3
−
3
View file @
8e348123
...
...
@@ -63,9 +63,9 @@ class Share extends \OC\Share\Constants {
/**
* Find which users can access a shared item
* @param $path to the file
* @param $user owner of the file
* @param include owner to the list of users with access to the file
* @param
string
$path to the file
* @param
string
$user owner of the file
* @param
bool $includeOwner
include owner to the list of users with access to the file
* @return array
* @note $path needs to be relative to user data dir, e.g. 'file.txt'
* not '/admin/data/file.txt'
...
...
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