From 4570bb4f65b9e7683e3ae0296585e460aa3c9470 Mon Sep 17 00:00:00 2001 From: szaimen Date: Wed, 21 Jul 2021 00:32:11 +0200 Subject: Admin Audit - Sharing: createShare - report the full path Signed-off-by: szaimen --- apps/admin_audit/lib/Actions/Sharing.php | 18 +++++++++--------- lib/private/Share20/LegacyHooks.php | 1 + tests/lib/Share20/LegacyHooksTest.php | 1 + 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/admin_audit/lib/Actions/Sharing.php b/apps/admin_audit/lib/Actions/Sharing.php index 98fbbf7fbd9..329ed740b53 100644 --- a/apps/admin_audit/lib/Actions/Sharing.php +++ b/apps/admin_audit/lib/Actions/Sharing.php @@ -50,7 +50,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'permissions', 'id', @@ -62,7 +62,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'shareWith', 'permissions', @@ -75,7 +75,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'shareWith', 'permissions', @@ -88,7 +88,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'shareWith', 'permissions', @@ -101,7 +101,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'shareWith', 'permissions', @@ -114,7 +114,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'shareWith', 'permissions', @@ -127,7 +127,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'shareWith', 'permissions', @@ -140,7 +140,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'shareWith', 'permissions', @@ -153,7 +153,7 @@ class Sharing extends Action { $params, [ 'itemType', - 'itemTarget', + 'path', 'itemSource', 'shareWith', 'permissions', diff --git a/lib/private/Share20/LegacyHooks.php b/lib/private/Share20/LegacyHooks.php index a1f856318c9..94cfa6636d7 100644 --- a/lib/private/Share20/LegacyHooks.php +++ b/lib/private/Share20/LegacyHooks.php @@ -170,6 +170,7 @@ class LegacyHooks { 'shareWith' => $share->getSharedWith(), 'itemTarget' => $share->getTarget(), 'fileTarget' => $share->getTarget(), + 'path' => $share->getNode()->getPath(), ]; \OC_Hook::emit(Share::class, 'post_shared', $postHookData); diff --git a/tests/lib/Share20/LegacyHooksTest.php b/tests/lib/Share20/LegacyHooksTest.php index a615e26afb0..5afee588c34 100644 --- a/tests/lib/Share20/LegacyHooksTest.php +++ b/tests/lib/Share20/LegacyHooksTest.php @@ -342,6 +342,7 @@ class LegacyHooksTest extends TestCase { 'permissions' => Constants::PERMISSION_ALL, 'expiration' => $date, 'token' => 'token', + 'path' => null, ]; $hookListner -- cgit v1.2.3