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
dc569ea3
Commit
dc569ea3
authored
12 years ago
by
Michael Gapczynski
Browse files
Options
Downloads
Patches
Plain Diff
Fix some warnings from Jenkins in the Share API
parent
db37a454
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/public/share.php
+2
-6
2 additions, 6 deletions
lib/public/share.php
with
2 additions
and
6 deletions
lib/public/share.php
+
2
−
6
View file @
dc569ea3
...
...
@@ -357,7 +357,7 @@ class Share {
if
(
$item
=
self
::
getItems
(
$itemType
,
$itemSource
,
$shareType
,
$shareWith
,
\OC_User
::
getUser
(),
self
::
FORMAT_NONE
,
null
,
1
,
false
))
{
// Check if this item is a reshare and verify that the permissions granted don't exceed the parent shared item
if
(
isset
(
$item
[
'parent'
]))
{
$query
=
\OC_DB
::
prepare
(
'SELECT `permissions` FROM `*PREFIX*share` WHERE `id` = ?'
,
1
);
$query
=
\OC_DB
::
prepare
(
'SELECT `permissions` FROM `*PREFIX*share` WHERE `id` = ?'
,
1
);
$result
=
$query
->
execute
(
array
(
$item
[
'parent'
]))
->
fetchRow
();
if
(
~
(
int
)
$result
[
'permissions'
]
&
$permissions
)
{
$message
=
'Setting permissions for '
.
$itemSource
.
' failed, because the permissions exceed permissions granted to '
.
\OC_User
::
getUser
();
...
...
@@ -813,9 +813,6 @@ class Share {
// Get group default file target
$groupFileTarget
=
$parentFolder
[
0
][
'folder'
]
.
$itemSource
;
$parent
=
$parentFolder
[
0
][
'id'
];
unset
(
$parentFolder
[
0
]);
// Only loop through users we know have different file target paths
$uidSharedWith
=
array_keys
(
$parentFolder
);
}
}
else
{
$groupFileTarget
=
self
::
generateTarget
(
'file'
,
$filePath
,
$shareType
,
$shareWith
[
'group'
],
$uidOwner
,
$suggestedFileTarget
);
...
...
@@ -826,7 +823,6 @@ class Share {
$query
->
execute
(
array
(
$itemType
,
$itemSource
,
$groupItemTarget
,
$parent
,
$shareType
,
$shareWith
[
'group'
],
$uidOwner
,
$permissions
,
time
(),
$fileSource
,
$groupFileTarget
));
// Save this id, any extra rows for this group share will need to reference it
$parent
=
\OC_DB
::
insertid
(
'*PREFIX*share'
);
$uniqueTargets
=
array
();
// Loop through all users of this group in case we need to add an extra row
foreach
(
$shareWith
[
'users'
]
as
$uid
)
{
$itemTarget
=
self
::
generateTarget
(
$itemType
,
$itemSource
,
self
::
SHARE_TYPE_USER
,
$uid
,
$uidOwner
,
$suggestedItemTarget
,
$parent
);
...
...
@@ -1054,7 +1050,7 @@ class Share {
// Insert an extra row for the group share if the item or file target is unique for this user
if
(
$itemTarget
!=
$item
[
'item_target'
]
||
$fileTarget
!=
$item
[
'file_target'
])
{
$query
->
execute
(
array
(
$item
[
'item_type'
],
$item
[
'item_source'
],
$itemTarget
,
$item
[
'id'
],
self
::
$shareTypeGroupUserUnique
,
$arguments
[
'uid'
],
$item
[
'uid_owner'
],
$item
[
'permissions'
],
$item
[
'stime'
],
$item
[
'file_source'
],
$fileTarget
));
$id
=
\OC_DB
::
insertid
(
'*PREFIX*share'
);
\OC_DB
::
insertid
(
'*PREFIX*share'
);
}
}
}
...
...
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