aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksander Piskun <oleksandr2088@icloud.com>2025-05-09 13:07:33 +0300
committerAndy Scherzinger <info@andy-scherzinger.de>2025-05-29 14:50:54 +0200
commitb33c27f0898ce5f2e19b6237a38df181a3df8aa0 (patch)
tree6ebfbb75c1dc582255ed0071232c8735f8be082c
parent3cd5adc056d9ddfe02a3ee52547db81344c630c0 (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(),
];