aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksander Piskun <oleksandr2088@icloud.com>2025-05-09 13:07:33 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-05-09 10:37:08 +0000
commit516ce0f2923f93d829a2cc7c2192680d0a96e108 (patch)
treea7695032a059fd28222b0ce4d363bbc03184b740
parentadc9e55b29a0647c9b1563769b413c374a421edb (diff)
downloadnextcloud-server-backport/52699/stable30.tar.gz
nextcloud-server-backport/52699/stable30.zip
fix(webhooks_listener): correctly set userId from eventbackport/52699/stable30
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
-rw-r--r--apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php3
-rw-r--r--apps/webhook_listeners/lib/Listener/WebhooksEventListener.php1
2 files changed, 3 insertions, 1 deletions
diff --git a/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php b/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php
index efc9401f44f..e59f4f74f1a 100644
--- a/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php
+++ b/apps/webhook_listeners/lib/BackgroundJobs/WebhookCall.php
@@ -72,7 +72,8 @@ class WebhookCall extends QueuedJob {
} elseif (!$exApp['enabled']) {
throw new RuntimeException('ExApp ' . $exAppId . ' is disabled.');
}
- $response = $appApiFunctions->exAppRequest($exAppId, $webhookUri, $webhookListener->getUserId(), $webhookListener->getHttpMethod(), [], $options);
+ $userId = ($data['user'] ?? [])['uid'] ?? null;
+ $response = $appApiFunctions->exAppRequest($exAppId, $webhookUri, $userId, $webhookListener->getHttpMethod(), [], $options);
if (is_array($response) && isset($response['error'])) {
throw new RuntimeException(sprintf('Error during request to ExApp(%s): %s', $exAppId, $response['error']));
}
diff --git a/apps/webhook_listeners/lib/Listener/WebhooksEventListener.php b/apps/webhook_listeners/lib/Listener/WebhooksEventListener.php
index 6b40af1463e..6cd3af98368 100644
--- a/apps/webhook_listeners/lib/Listener/WebhooksEventListener.php
+++ b/apps/webhook_listeners/lib/Listener/WebhooksEventListener.php
@@ -41,6 +41,7 @@ class WebhooksEventListener implements IEventListener {
// TODO add group membership to be able to filter on it
$data = [
'event' => $this->serializeEvent($event),
+ /* Do not remove 'user' from here, see BackgroundJobs/WebhookCall.php */
'user' => (is_null($user) ? null : JsonSerializer::serializeUser($user)),
'time' => time(),
];