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
b7bf28d1
Commit
b7bf28d1
authored
12 years ago
by
Florian Hülsmann
Browse files
Options
Downloads
Patches
Plain Diff
Hook emission on sharing stuff
parent
da57fbc9
No related branches found
Branches containing commit
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
+30
-1
30 additions, 1 deletion
lib/public/share.php
with
30 additions
and
1 deletion
lib/public/share.php
+
30
−
1
View file @
b7bf28d1
...
...
@@ -28,6 +28,9 @@ namespace OCP;
/**
* This class provides the ability for apps to share their content between users.
* Apps must create a backend class that implements OCP\Share_Backend and register it with this class.
*
* It provides the following hooks:
* - post_shared
*/
class
Share
{
...
...
@@ -937,7 +940,20 @@ class Share {
// Insert an extra row for the group share if the item or file target is unique for this user
if
(
$itemTarget
!=
$groupItemTarget
||
(
isset
(
$fileSource
)
&&
$fileTarget
!=
$groupFileTarget
))
{
$query
->
execute
(
array
(
$itemType
,
$itemSource
,
$itemTarget
,
$parent
,
self
::
$shareTypeGroupUserUnique
,
$uid
,
$uidOwner
,
$permissions
,
time
(),
$fileSource
,
$fileTarget
));
\OC_DB
::
insertid
(
'*PREFIX*share'
);
$id
=
\OC_DB
::
insertid
(
'*PREFIX*share'
);
\OC_Hook
::
emit
(
'OCP\Share'
,
'post_shared'
,
array
(
'itemType'
=>
$itemType
,
'itemSource'
=>
$itemSource
,
'itemTarget'
=>
$itemTarget
,
'parent'
=>
$parent
,
'shareType'
=>
self
::
$shareTypeGroupUserUnique
,
'shareWith'
=>
$uid
,
'uidOwner'
=>
$uidOwner
,
'permissions'
=>
$permissions
,
'fileSource'
=>
$fileSource
,
'fileTarget'
=>
$fileTarget
,
'id'
=>
$id
));
}
}
if
(
$parentFolder
===
true
)
{
...
...
@@ -963,6 +979,19 @@ class Share {
}
$query
->
execute
(
array
(
$itemType
,
$itemSource
,
$itemTarget
,
$parent
,
$shareType
,
$shareWith
,
$uidOwner
,
$permissions
,
time
(),
$fileSource
,
$fileTarget
));
$id
=
\OC_DB
::
insertid
(
'*PREFIX*share'
);
\OC_Hook
::
emit
(
'OCP\Share'
,
'post_shared'
,
array
(
'itemType'
=>
$itemType
,
'itemSource'
=>
$itemSource
,
'itemTarget'
=>
$itemTarget
,
'parent'
=>
$parent
,
'shareType'
=>
$shareType
,
'shareWith'
=>
$shareWith
,
'uidOwner'
=>
$uidOwner
,
'permissions'
=>
$permissions
,
'fileSource'
=>
$fileSource
,
'fileTarget'
=>
$fileTarget
,
'id'
=>
$id
));
if
(
$parentFolder
===
true
)
{
$parentFolders
[
'id'
]
=
$id
;
// Return parent folder to preserve file target paths for potential children
...
...
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